Expose source path on LogFileInterface
Add LogFileInterface::getPath(): ?string so detectors can dispatch on a filename hint when the original path is known. Default implementation on the abstract LogFile base returns null; PathLogFile records its constructor argument. StringLogFile and StreamLogFile inherit the null default. Tests cover both the path and null-fallback cases.
This commit is contained in:
@@ -14,4 +14,11 @@ class StringLogFileTest extends TestCase
|
||||
|
||||
$this->assertEquals($content, $logFile->getContent());
|
||||
}
|
||||
|
||||
public function testGetPathReturnsNull(): void
|
||||
{
|
||||
$logFile = new StringLogFile("anything");
|
||||
|
||||
$this->assertNull($logFile->getPath());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user