From 26e56842dc00e2a402b058d330aeb30ef53dd804 Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Sun, 11 Nov 2012 21:05:22 +0100 Subject: [PATCH] some type fixes --- .../Command/RouterDebugCommand.php | 3 +-- .../Component/Routing/CompiledRoute.php | 18 +++++++++--------- .../Matcher/Dumper/DumperCollection.php | 1 + .../Component/Routing/RouteCollection.php | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php index df266c8e55..161438674a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php @@ -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())); } diff --git a/src/Symfony/Component/Routing/CompiledRoute.php b/src/Symfony/Component/Routing/CompiledRoute.php index 7f02f60443..1ccad3c22a 100644 --- a/src/Symfony/Component/Routing/CompiledRoute.php +++ b/src/Symfony/Component/Routing/CompiledRoute.php @@ -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; diff --git a/src/Symfony/Component/Routing/Matcher/Dumper/DumperCollection.php b/src/Symfony/Component/Routing/Matcher/Dumper/DumperCollection.php index bba0c27d0b..8b36d0896a 100644 --- a/src/Symfony/Component/Routing/Matcher/Dumper/DumperCollection.php +++ b/src/Symfony/Component/Routing/Matcher/Dumper/DumperCollection.php @@ -20,6 +20,7 @@ class DumperCollection implements \IteratorAggregate { private $parent; private $children = array(); + private $attributes = array(); /** * Returns the children routes and collections. diff --git a/src/Symfony/Component/Routing/RouteCollection.php b/src/Symfony/Component/Routing/RouteCollection.php index d871442ac5..38c82a85f6 100644 --- a/src/Symfony/Component/Routing/RouteCollection.php +++ b/src/Symfony/Component/Routing/RouteCollection.php @@ -282,7 +282,7 @@ class RouteCollection implements \IteratorAggregate, \Countable */ public function setHostnamePattern($pattern) { - $this->hostnamePattern = $pattern; + $this->hostnamePattern = (string) $pattern; if ('' === $pattern) { return;