Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions build/build-preload.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,11 @@ final class PreloadBuilder
// edge case during Rector tests case, happens when
// 1. phpstan autoload test case is triggered first,
// 2. all php-parser classes are loaded,
if (defined('PHPUNIT_COMPOSER_INSTALL') && isPHPStanTestPreloaded()) {
if (defined('PHPUNIT_COMPOSER_INSTALL')
&& class_exists(PHPStanTestCase::class, false)
&& interface_exists(Node::class, false)) {
return;
}

function isPHPStanTestPreloaded(): bool
{
if (! class_exists(PHPStanTestCase::class, false)) {
return false;
}

return interface_exists(Node::class, false);
}
CODE_SAMPLE;

/**
Expand Down
13 changes: 3 additions & 10 deletions preload-split-package.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,12 @@
// edge case during Rector tests case, happens when
// 1. phpstan autoload test case is triggered first,
// 2. all php-parser classes are loaded,
if (defined('PHPUNIT_COMPOSER_INSTALL') && isPHPStanTestPreloaded()) {
if (defined('PHPUNIT_COMPOSER_INSTALL')
&& class_exists(PHPStanTestCase::class, false)
&& interface_exists(Node::class, false)) {
return;
}

function isPHPStanTestPreloaded(): bool
{
if (! class_exists(PHPStanTestCase::class, false)) {
return false;
}

return interface_exists(Node::class, false);
}

require_once __DIR__ . '/../../../vendor/nikic/php-parser/lib/PhpParser/Node.php';
require_once __DIR__ . '/src/Contract/PhpParser/Node/StmtsAwareInterface.php';
require_once __DIR__ . '/../../../vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php';
Expand Down
13 changes: 3 additions & 10 deletions preload.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,12 @@
// edge case during Rector tests case, happens when
// 1. phpstan autoload test case is triggered first,
// 2. all php-parser classes are loaded,
if (defined('PHPUNIT_COMPOSER_INSTALL') && isPHPStanTestPreloaded()) {
if (defined('PHPUNIT_COMPOSER_INSTALL')
&& class_exists(PHPStanTestCase::class, false)
&& interface_exists(Node::class, false)) {
return;
}

function isPHPStanTestPreloaded(): bool
{
if (! class_exists(PHPStanTestCase::class, false)) {
return false;
}

return interface_exists(Node::class, false);
}

require_once __DIR__ . '/vendor/nikic/php-parser/lib/PhpParser/Node.php';
require_once __DIR__ . '/src/Contract/PhpParser/Node/StmtsAwareInterface.php';
require_once __DIR__ . '/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php';
Expand Down