8000 Try to not break BC · symfony/symfony@b7ea19b · GitHub
[go: up one dir, main page]

Skip to content

Commit b7ea19b

Browse files
committed
Try to not break BC
1 parent c837c41 commit b7ea19b

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/Symfony/Bundle/WebProfilerBundle/Resources/config/profiler.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,10 @@
5454

5555
<service id="debug.file_link_formatter" class="Symfony\Component\HttpKernel\Debug\FileLinkFormatter">
5656
<argument>%debug.file_link_format%</argument>
57-
<argument type="service" id="router" on-invalid="null" />
57+
<argument>null</argument> <!-- unused, to be removed in Symfony 4.0 -->
5858
<argument>null</argument>
5959
<argument>?file=%%f&amp;line=%%l#line%%l</argument>
60+
<argument type="service" id="router" on-invalid="null" />
6061
</service>
6162
</services>
6263
</container>

src/Symfony/Component/HttpKernel/Debug/FileLinkFormatter.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\HttpKernel\Debug;
1313

14+
use Symfony\Component\HttpFoundation\RequestStack;
1415
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
1516

1617
/**
@@ -25,8 +26,9 @@ class FileLinkFormatter implements \Serializable
2526
private $baseDir;
2627
private $queryString;
2728

28-
public function __construct($fileLinkFormat = null, UrlGeneratorInterface $router = null, $baseDir = null, $queryString = null)
29+
public function __construct($fileLinkFormat = null, RequestStack $requestStack = null, $baseDir = null, $queryString = null, UrlGeneratorInterface $router = null)
2930
{
31+
// TODO: '$requestStack' constructor argument is unused. Remove it in Symfony 4.0.
3032
$fileLinkFormat = $fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
3133
if ($fileLinkFormat && !is_array($fileLinkFormat)) {
3234
$i = strpos($f = $fileLinkFormat, '&', max(strrpos($f, '%f'), strrpos($f, '%l'))) ?: strlen($f);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function testWhenFileLinkFormatAndRouter()
4242
$baseDir = __DIR__;
4343
$router = $this->getRouter();
4444

45-
$sut = new FileLinkFormatter('debug://open?url=file://%f&line=%l', $router, $baseDir, '/_profiler/open?file=%f&line=%l#line%l');
45+
$sut = new FileLinkFormatter('debug://open?url=file://%f&line=%l', null, $baseDir, '/_profiler/open?file=%f&line=%l#line%l', $router);
4646

4747
$this->assertSame("debug://open?url=file://$file&line=3", $sut->format($file, 3));
4848
}
@@ -53,7 +53,7 @@ public function testWhenNoFileLinkFormatAndRouter()
5353
$baseDir = __DIR__;
5454
$router = $this->getRouter();
5555

56-
$sut = new FileLinkFormatter(null, $router, $baseDir, '?file=%f&line=%l#line%l');
56+
$sut = new FileLinkFormatter(null, null, $baseDir, '?file=%f&line=%l#line%l', $router);
5757

5858
$this->assertSame('/_profiler_customized?file=file.php&line=3#line3', $sut->format($file, 3));
5959
}

0 commit comments

Comments
 (0)
0