Closed thekid closed 1 year ago
This PR adds -c [check] to the command line to check for certain aspects at compile time.
-c [check]
Given the following code inside a file Overriding.php:
<?php class Overriding { #[Override] public function fixture() { } }
...the compilation yields:
$ xp compile -c method-overriding Overriding.php > /dev/null ! Overriding.php: Overriding::fixture() has #[\Override] attribute, but no matching parent method exists [line 5 of Overriding.php] × Compiled 1 file(s) to - using lang.ast.emit.PHP82, 1 error(s) occurred Memory used: 2566.99 kB (2619.85 kB peak) Time taken: 0.008 seconds
Closing in favor of #173
This PR adds
-c [check]
to the command line to check for certain aspects at compile time.Included checks
Example
Given the following code inside a file Overriding.php:
...the compilation yields: