Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 81357bf

Browse filesBrowse files
committed
bug #43947 [HttpKernel] Make sure FileLinkFormatter can be serialized (derrabus)
This PR was merged into the 6.0 branch. Discussion ---------- [HttpKernel] Make sure FileLinkFormatter can be serialized | Q | A | ------------- | --- | Branch? | 6.0 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | N/A | License | MIT | Doc PR | N/A We currently get a `TypeError` when serializing a `FileLinkFormatter`. This PR should help. Commits ------- 8a9b3c7 Make sure FileLinkFormatter can be serialized
2 parents aaf4c32 + 8a9b3c7 commit 81357bf
Copy full SHA for 81357bf

File tree

2 files changed

+7
-2
lines changed
Filter options

2 files changed

+7
-2
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/Debug/FileLinkFormatter.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public static function generateUrlFormat(UrlGeneratorInterface $router, string $
9494
}
9595
}
9696

97-
private function getFileLinkFormat()
97+
private function getFileLinkFormat(): array|false
9898
{
9999
if ($this->fileLinkFormat) {
100100
return $this->fileLinkFormat;
@@ -111,6 +111,6 @@ private function getFileLinkFormat()
111111
}
112112
}
113113

114-
return null;
114+
return false;
115115
}
116116
}

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/Tests/Debug/FileLinkFormatterTest.php
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,9 @@ public function testIdeFileLinkFormat()
6060

6161
$this->assertSame("atom://core/open/file?filename=$file&line=3", $sut->format($file, 3));
6262
}
63+
64+
public function testSerialize()
65+
{
66+
$this->assertInstanceOf(FileLinkFormatter::class, unserialize(serialize(new FileLinkFormatter())));
67+
}
6368
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.