8000 Optimized code · symfony/symfony@c837c41 · GitHub
[go: up one dir, main page]

Skip to content

Commit c837c41

Browse files
committed
Optimized code
1 parent edd0a76 commit c837c41

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/Symfony/Component/HttpKernel/Tests/Debug/FileLinkFormatterTest.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\HttpKernel\Debug\FileLinkFormatter;
16-
use Symfony\Component\Routing\Loader\ClosureLoader;
16+
use Symfony\Component\Routing\Generator\UrlGenerator;
17+
use Symfony\Component\Routing\RequestContext;
1718
use Symfony\Component\Routing\Route;
1819
use Symfony\Component\Routing\RouteCollection;
19-
use Symfony\Component\Routing\Router;
2020

2121
class FileLinkFormatterTest extends TestCase
2222
{
@@ -60,13 +60,9 @@ public function testWhenNoFileLinkFormatAndRouter()
6060

6161
private function getRouter()
6262
{
63-
$routeCollection = function () {
64-
$routes = new RouteCollection();
65-
$routes->add('_profiler_open_file', new Route('/_profiler_customized'));
63+
$routes = new RouteCollection();
64+
$routes->add('_profiler_open_file', new Route('/_profiler_customized'));
6665

67-
return $routes;
68-
};
69-
70-
return new Router(new ClosureLoader(), $routeCollection);
66+
return new UrlGenerator($routes, new RequestContext());
7167
}
7268
}

0 commit comments

Comments
 (0)
0