Skip to content

Commit d2f0eb5

Browse files
committed
Make sure FileLinkFormatter can be serialized
Signed-off-by: Alexander M. Turek <me@derrabus.de>
1 parent 8d4cc9a commit d2f0eb5

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Debug/FileLinkFormatter.php

Lines 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
}

Tests/Debug/FileLinkFormatterTest.php

Lines 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)