diff --git a/packages/guides/src/Event/PostParseDocument.php b/packages/guides/src/Event/PostParseDocument.php index f252473e4..017b8511b 100644 --- a/packages/guides/src/Event/PostParseDocument.php +++ b/packages/guides/src/Event/PostParseDocument.php @@ -22,8 +22,11 @@ */ final class PostParseDocument { - public function __construct(private readonly string $fileName, private readonly DocumentNode|null $documentNode) - { + public function __construct( + private readonly string $fileName, + private DocumentNode|null $documentNode, + private readonly string $originalFile, + ) { } public function getDocumentNode(): DocumentNode|null @@ -31,8 +34,18 @@ public function getDocumentNode(): DocumentNode|null return $this->documentNode; } + public function setDocumentNode(DocumentNode|null $documentNode): void + { + $this->documentNode = $documentNode; + } + public function getFileName(): string { return $this->fileName; } + + public function getOriginalFileName(): string + { + return $this->originalFile; + } } diff --git a/packages/guides/src/Handlers/ParseFileHandler.php b/packages/guides/src/Handlers/ParseFileHandler.php index 548f119b9..f68262caf 100644 --- a/packages/guides/src/Handlers/ParseFileHandler.php +++ b/packages/guides/src/Handlers/ParseFileHandler.php @@ -103,7 +103,7 @@ private function createDocument( ); } - $event = $this->eventDispatcher->dispatch(new PostParseDocument($fileName, $document)); + $event = $this->eventDispatcher->dispatch(new PostParseDocument($fileName, $document, $path)); assert($event instanceof PostParseDocument); return $event->getDocumentNode();