Skip to content

Commit c587879

Browse files
committed
Add const replace in global file
1 parent bd2238e commit c587879

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: src/Compiler/Compiler.php

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use PhpParser\ParserFactory;
1919
use PhpParser\PrettyPrinter\Standard;
2020
use PhpParser\PrettyPrinterAbstract;
21+
use Serafim\Contracts\Compiler\Visitor\ConstReplaceVisitor;
2122
use Serafim\Contracts\Compiler\Visitor\ContractsApplicatorVisitor;
2223
use Serafim\Contracts\Compiler\Visitor\ExceptionDecoratorVisitor;
2324
use Serafim\Contracts\Exception\Decorator;
@@ -88,6 +89,7 @@ public function compile(string $pathname): string
8889

8990
$traverser = new NodeTraverser();
9091
$traverser->addVisitor(new NameResolver(options: ['preserveOriginalNames' => true]));
92+
$traverser->addVisitor(new ConstReplaceVisitor($pathname, 1));
9193
$traverser->addVisitor(new ExceptionDecoratorVisitor($pathname));
9294
$traverser->addVisitor(new ContractsApplicatorVisitor($pathname, $this->contracts, $this->injector));
9395

0 commit comments

Comments
 (0)