Could not process [path] file, due to: Undefined constant #7212
|
Dear Rector community, we are preparing support for PHP 8.0 in Mautic and the Rector v0.12.22 is passing on PHP 7.4 but failing on PHP 8.0 with error message: We cannot understand why when looking at the file on that line: This "fix" made the CI pass but it's not optimal: Can anyone give us some pointers about why is it failing and what would be the correct fix? |
Answered by
samsonasik
Jun 6, 2022
Replies: 2 comments
|
Hi Honza, there have been many new releases of PHPStan 1.7.* that handles magical autoloading in different way. |
0 replies
|
You can define your own bootstrap file instead of define it in the rector.php, so you can configure: // do you need to include constants, class aliases or custom autoloader? files listed will be executed
$rectorConfig->bootstrapFiles([
__DIR__ . '/bootstrap.php',
]);ref https://github.com/rectorphp/rector/blob/main/docs/static_reflection_and_autoload.md#include-files |
0 replies
Answer selected by
samsonasik
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can define your own bootstrap file instead of define it in the rector.php, so you can configure:
ref https://github.com/rectorphp/rector/blob/main/docs/static_reflection_and_autoload.md#include-files