File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,13 +58,6 @@ final class PreloadBuilder
5858 return;
5959}
6060
61- // edge case during Rector tests case, happens when
62- // 1. phpstan autoload test case is triggered first,
63- // 2. all php-parser classes are loaded,
64- if (defined('PHPUNIT_COMPOSER_INSTALL') && isPHPStanTestPreloaded()) {
65- return;
66- }
67-
6861if (! function_exists('isPHPStanTestPreloaded')) {
6962 function isPHPStanTestPreloaded(): bool
7063 {
@@ -75,6 +68,13 @@ function isPHPStanTestPreloaded(): bool
7568 return interface_exists(Node::class, false);
7669 }
7770}
71+
72+ // edge case during Rector tests case, happens when
73+ // 1. phpstan autoload test case is triggered first,
74+ // 2. all php-parser classes are loaded,
75+ if (defined('PHPUNIT_COMPOSER_INSTALL') && isPHPStanTestPreloaded()) {
76+ return;
77+ }
7878CODE_SAMPLE;
7979
8080 /**
Original file line number Diff line number Diff line change 99 return ;
1010}
1111
12- // edge case during Rector tests case, happens when
13- // 1. phpstan autoload test case is triggered first,
14- // 2. all php-parser classes are loaded,
15- if (defined ('PHPUNIT_COMPOSER_INSTALL ' ) && isPHPStanTestPreloaded ()) {
16- return ;
17- }
18-
1912if (! function_exists ('isPHPStanTestPreloaded ' )) {
2013 function isPHPStanTestPreloaded (): bool
2114 {
@@ -27,6 +20,13 @@ function isPHPStanTestPreloaded(): bool
2720 }
2821}
2922
23+ // edge case during Rector tests case, happens when
24+ // 1. phpstan autoload test case is triggered first,
25+ // 2. all php-parser classes are loaded,
26+ if (defined ('PHPUNIT_COMPOSER_INSTALL ' ) && isPHPStanTestPreloaded ()) {
27+ return ;
28+ }
29+
3030require_once __DIR__ . '/../../../vendor/nikic/php-parser/lib/PhpParser/Node.php ' ;
3131require_once __DIR__ . '/src/Contract/PhpParser/Node/StmtsAwareInterface.php ' ;
3232require_once __DIR__ . '/../../../vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php ' ;
Original file line number Diff line number Diff line change 99 return ;
1010}
1111
12- // edge case during Rector tests case, happens when
13- // 1. phpstan autoload test case is triggered first,
14- // 2. all php-parser classes are loaded,
15- if (defined ('PHPUNIT_COMPOSER_INSTALL ' ) && isPHPStanTestPreloaded ()) {
16- return ;
17- }
18-
1912if (! function_exists ('isPHPStanTestPreloaded ' )) {
2013 function isPHPStanTestPreloaded (): bool
2114 {
@@ -27,6 +20,13 @@ function isPHPStanTestPreloaded(): bool
2720 }
2821}
2922
23+ // edge case during Rector tests case, happens when
24+ // 1. phpstan autoload test case is triggered first,
25+ // 2. all php-parser classes are loaded,
26+ if (defined ('PHPUNIT_COMPOSER_INSTALL ' ) && isPHPStanTestPreloaded ()) {
27+ return ;
28+ }
29+
3030require_once __DIR__ . '/vendor/nikic/php-parser/lib/PhpParser/Node.php ' ;
3131require_once __DIR__ . '/src/Contract/PhpParser/Node/StmtsAwareInterface.php ' ;
3232require_once __DIR__ . '/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php ' ;
You can’t perform that action at this time.
0 commit comments