Bug Report
| Subject |
Details |
| Rector version |
e.g. 2.5.7 |
Minimal PHP Code Causing Issue
In PHPStan if you use a bootstrap file in the NEON config, it will be included with a global $container variable available to it, see
https://github.com/phpstan/phpstan-src/blob/e911cc96ac19cc55b3c5a54d379fd59bc2ab0f7d/src/Command/CommandHelper.php#L643-L645
I am sharing bootstrap files in projects between phpstan and rector, as these affect type inference in my cases.
would be great rector could also hand the PHPStan $container (DI-Container) into bootstrap files
Expected Behaviour
no fatal error like
➜ kunzmann git:(dba-cache) vendor/bin/rector process app/admin/ -a app/admin/phpstan-bootstrap.php
[ERROR] Call to a member function getParameter() on null
for a phpstan-bootstrap.php like
<?php
/** @var \PHPStan\DependencyInjection\Container $container */
$resultCachePath = $container->getParameter('resultCachePath');
Bug Report
Minimal PHP Code Causing Issue
In PHPStan if you use a bootstrap file in the NEON config, it will be included with a global
$containervariable available to it, seehttps://github.com/phpstan/phpstan-src/blob/e911cc96ac19cc55b3c5a54d379fd59bc2ab0f7d/src/Command/CommandHelper.php#L643-L645
I am sharing bootstrap files in projects between phpstan and rector, as these affect type inference in my cases.
would be great rector could also hand the PHPStan $container (DI-Container) into bootstrap files
Expected Behaviour
no fatal error like
for a
phpstan-bootstrap.phplike