Skip to content

Commit

Permalink
some type fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobion authored and arnaud-lb committed Nov 12, 2012
1 parent 514e27a commit 26e5684
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Expand Up @@ -15,7 +15,6 @@
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Routing\RouterInterface; use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Console\Output\Output;


/** /**
* A console command for retrieving information about routes * A console command for retrieving information about routes
Expand Down Expand Up @@ -112,7 +111,7 @@ protected function outputRoutes(OutputInterface $output, $routes = null)
? implode(', ', $requirements['_method']) : $requirements['_method'] ? implode(', ', $requirements['_method']) : $requirements['_method']
) )
: 'ANY'; : 'ANY';
$hostname = null !== $route->getHostnamePattern() $hostname = '' !== $route->getHostnamePattern()
? $route->getHostnamePattern() : 'ANY'; ? $route->getHostnamePattern() : 'ANY';
$output->writeln(sprintf($format, $name, $method, $hostname, $route->getPattern())); $output->writeln(sprintf($format, $name, $method, $hostname, $route->getPattern()));
} }
Expand Down
18 changes: 9 additions & 9 deletions src/Symfony/Component/Routing/CompiledRoute.php
Expand Up @@ -30,18 +30,18 @@ class CompiledRoute
/** /**
* Constructor. * Constructor.
* *
* @param string $staticPrefix The static prefix of the compiled route * @param string $staticPrefix The static prefix of the compiled route
* @param string $regex The regular expression to use to match this 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 $tokens An array of tokens to use to generate URL for this route
* @param array $pathVariables An array of path variables * @param array $pathVariables An array of path variables
* @param array $hostnameRegex|null Hostname regex * @param string|null $hostnameRegex Hostname regex
* @param array $hostnameTokens Hostname tokens * @param array $hostnameTokens Hostname tokens
* @param array $hostnameVariables An array of hostname variables * @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 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()) 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->regex = $regex;
$this->tokens = $tokens; $this->tokens = $tokens;
$this->pathVariables = $pathVariables; $this->pathVariables = $pathVariables;
Expand Down
Expand Up @@ -20,6 +20,7 @@ class DumperCollection implements \IteratorAggregate
{ {
private $parent; private $parent;
private $children = array(); private $children = array();
private $attributes = array();


/** /**
* Returns the children routes and collections. * Returns the children routes and collections.
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Routing/RouteCollection.php
Expand Up @@ -282,7 +282,7 @@ public function getHostnamePattern()
*/ */
public function setHostnamePattern($pattern) public function setHostnamePattern($pattern)
{ {
$this->hostnamePattern = $pattern; $this->hostnamePattern = (string) $pattern;


if ('' === $pattern) { if ('' === $pattern) {
return; return;
Expand Down

0 comments on commit 26e5684

Please sign in to comment.