Skip to content

Commit e524d28

Browse files
[HttpKernel][ErrorHandler] Fix reading the SYMFONY_IDE env var
1 parent 5594256 commit e524d28

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Debug/FileLinkFormatter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ class FileLinkFormatter
3535
*/
3636
public function __construct(string|array $fileLinkFormat = null, RequestStack $requestStack = null, string $baseDir = null, string|\Closure $urlFormat = null)
3737
{
38-
$fileLinkFormat ??= $_SERVER['SYMFONY_IDE'] ?? '';
38+
$fileLinkFormat ??= $_ENV['SYMFONY_IDE'] ?? $_SERVER['SYMFONY_IDE'] ?? '';
39+
3940
if (!\is_array($fileLinkFormat) && $fileLinkFormat = (ErrorRendererInterface::IDE_LINK_FORMATS[$fileLinkFormat] ?? $fileLinkFormat) ?: \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: false) {
4041
$i = strpos($f = $fileLinkFormat, '&', max(strrpos($f, '%f'), strrpos($f, '%l'))) ?: \strlen($f);
4142
$fileLinkFormat = [substr($f, 0, $i)] + preg_split('/&([^>]++)>/', substr($f, $i), -1, \PREG_SPLIT_DELIM_CAPTURE);

phpunit.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
>
1111
<php>
1212
<ini name="error_reporting" value="-1" />
13+
<env name="SYMFONY_IDE" value="" force="true" />
1314
</php>
1415

1516
<testsuites>

0 commit comments

Comments
 (0)