diff --git a/phpstan-bootstrap.php b/phpstan-bootstrap.php index ce8e4636bd11..0f45bf0cb559 100644 --- a/phpstan-bootstrap.php +++ b/phpstan-bootstrap.php @@ -2,6 +2,17 @@ require __DIR__ . '/system/util_bootstrap.php'; -if (! defined('OCI_COMMIT_ON_SUCCESS')) { - define('OCI_COMMIT_ON_SUCCESS', 32); +defined('OCI_COMMIT_ON_SUCCESS') || define('OCI_COMMIT_ON_SUCCESS', 32); + +foreach ([ + 'app/Config', +] as $directory) { + $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory)); + + /** @var SplFileInfo $file */ + foreach ($iterator as $file) { + if ($file->isFile() && $file->getExtension() === 'php') { + require_once $file->getRealPath(); + } + } } diff --git a/rector.php b/rector.php index 4f1504f270be..c814a7402c4d 100644 --- a/rector.php +++ b/rector.php @@ -71,7 +71,7 @@ ]) // do you need to include constants, class aliases or custom autoloader? files listed will be executed ->withBootstrapFiles([ - __DIR__ . '/system/util_bootstrap.php', + __DIR__ . '/phpstan-bootstrap.php', ]) ->withPHPStanConfigs([ __DIR__ . '/phpstan.neon.dist',