Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 469330d

Browse files
committed
merged branch Tobion/typhint-routing-profiler (PR #7377)
This PR was submitted for the 2.2 branch but it was merged into the master branch instead (closes #7377). Commits ------- a58a443 [WebProfiler] add missing typehint to RouterController Discussion ---------- [WebProfiler] add missing typehint to RouterController It must be a RouteCollection because TraceableUrlMatcher expects it anyway. | Q | A | ------------- | --- | Bug fix? | [no] | New feature? | [no] | BC breaks? | [no] | Deprecations? | [no] | Tests pass? | [yes] | License | MIT
2 parents d699a92 + 395c509 commit 469330d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Symfony/Bundle/WebProfilerBundle/Controller/RouterController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\HttpFoundation\Response;
1515
use Symfony\Component\Routing\Matcher\UrlMatcherInterface;
1616
use Symfony\Component\Routing\Matcher\TraceableUrlMatcher;
17+
use Symfony\Component\Routing\RouteCollection;
1718
use Symfony\Component\Routing\RouterInterface;
1819
use Symfony\Component\HttpKernel\Profiler\Profiler;
1920

@@ -29,14 +30,14 @@ class RouterController
2930
private $matcher;
3031
private $routes;
3132

32-
public function __construct(Profiler $profiler, \Twig_Environment $twig, UrlMatcherInterface $matcher = null, $routes = null)
33+
public function __construct(Profiler $profiler, \Twig_Environment $twig, UrlMatcherInterface $matcher = null, RouteCollection $routes = null)
3334
{
3435
$this->profiler = $profiler;
3536
$this->twig = $twig;
3637
$this->matcher = $matcher;
3738
$this->routes = $routes;
3839

39-
if (null === $this->routes && null !== $this->matcher && $this->matcher instanceof RouterInterface) {
40+
if (null === $this->routes && $this->matcher instanceof RouterInterface) {
4041
$this->routes = $matcher->getRouteCollection();
4142
}
4243
}

0 commit comments

Comments
 (0)