Skip to content

Commit 691e7ba

Browse files
authored
Add check phpstan if phpstan is running on preload.php (#7040)
1 parent 6d046c1 commit 691e7ba

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

build/build-preload.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ final class PreloadBuilder
5151
5252
declare(strict_types=1);
5353
54+
if (defined('__PHPSTAN_RUNNING__')) {
55+
return;
56+
}
57+
5458

5559
CODE_SAMPLE;
5660

preload-split-package.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
declare(strict_types=1);
44

5+
if (defined('__PHPSTAN_RUNNING__')) {
6+
return;
7+
}
8+
59
require_once __DIR__ . '/../../../vendor/nikic/php-parser/lib/PhpParser/Node.php';
610
require_once __DIR__ . '/src/Contract/PhpParser/Node/StmtsAwareInterface.php';
711
require_once __DIR__ . '/../../../vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php';

preload.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
declare(strict_types=1);
44

5+
if (defined('__PHPSTAN_RUNNING__')) {
6+
return;
7+
}
8+
59
require_once __DIR__ . '/vendor/nikic/php-parser/lib/PhpParser/Node.php';
610
require_once __DIR__ . '/src/Contract/PhpParser/Node/StmtsAwareInterface.php';
711
require_once __DIR__ . '/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php';

0 commit comments

Comments
 (0)