Skip to content

Commit c7f2c80

Browse files
authored
chore: fix rector crash (#9608)
1 parent 80005b2 commit c7f2c80

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

phpstan-bootstrap.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
require __DIR__ . '/system/util_bootstrap.php';
44

5-
if (! defined('OCI_COMMIT_ON_SUCCESS')) {
6-
define('OCI_COMMIT_ON_SUCCESS', 32);
5+
defined('OCI_COMMIT_ON_SUCCESS') || define('OCI_COMMIT_ON_SUCCESS', 32);
6+
7+
foreach ([
8+
'app/Config',
9+
] as $directory) {
10+
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory));
11+
12+
/** @var SplFileInfo $file */
13+
foreach ($iterator as $file) {
14+
if ($file->isFile() && $file->getExtension() === 'php') {
15+
require_once $file->getRealPath();
16+
}
17+
}
718
}

rector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
])
7272
// do you need to include constants, class aliases or custom autoloader? files listed will be executed
7373
->withBootstrapFiles([
74-
__DIR__ . '/system/util_bootstrap.php',
74+
__DIR__ . '/phpstan-bootstrap.php',
7575
])
7676
->withPHPStanConfigs([
7777
__DIR__ . '/phpstan.neon.dist',

0 commit comments

Comments
 (0)