some type fixes

This commit is contained in:
Tobias Schultze 2012-11-11 21:05:22 +01:00 committed by Arnaud Le Blanc
parent 514e27a511
commit 26e56842dc
4 changed files with 12 additions and 12 deletions

View File

@ -15,7 +15,6 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Console\Output\Output;
/**
* A console command for retrieving information about routes
@ -112,7 +111,7 @@ EOF
? implode(', ', $requirements['_method']) : $requirements['_method']
)
: 'ANY';
$hostname = null !== $route->getHostnamePattern()
$hostname = '' !== $route->getHostnamePattern()
? $route->getHostnamePattern() : 'ANY';
$output->writeln(sprintf($format, $name, $method, $hostname, $route->getPattern()));
}

View File

@ -30,18 +30,18 @@ class CompiledRoute
/**
* Constructor.
*
* @param string $staticPrefix The static prefix of the compiled route
* @param string $regex The regular expression to use to match this route
* @param array $tokens An array of tokens to use to generate URL for this route
* @param array $pathVariables An array of path variables
* @param array $hostnameRegex|null Hostname regex
* @param array $hostnameTokens Hostname tokens
* @param array $hostnameVariables An array of hostname variables
* @param array $variables An array of variables (variables defined in the path and in the hostname patterns)
* @param string $staticPrefix The static prefix of the compiled route
* @param string $regex The regular expression to use to match this route
* @param array $tokens An array of tokens to use to generate URL for this route
* @param array $pathVariables An array of path variables
* @param string|null $hostnameRegex Hostname regex
* @param array $hostnameTokens Hostname tokens
* @param array $hostnameVariables An array of hostname variables
* @param array $variables An array of variables (variables defined in the path and in the hostname patterns)
*/
public function __construct($staticPrefix, $regex, array $tokens, array $pathVariables, $hostnameRegex = null, array $hostnameTokens = array(), array $hostnameVariables = array(), array $variables = array())
{
$this->staticPrefix = $staticPrefix;
$this->staticPrefix = (string) $staticPrefix;
$this->regex = $regex;
$this->tokens = $tokens;
$this->pathVariables = $pathVariables;

View File

@ -20,6 +20,7 @@ class DumperCollection implements \IteratorAggregate
{
private $parent;
private $children = array();
private $attributes = array();
/**
* Returns the children routes and collections.

View File

@ -282,7 +282,7 @@ class RouteCollection implements \IteratorAggregate, \Countable
*/
public function setHostnamePattern($pattern)
{
$this->hostnamePattern = $pattern;
$this->hostnamePattern = (string) $pattern;
if ('' === $pattern) {
return;