Abdul Malik Ikhsan
Abdul Malik Ikhsan
It seems only happen on trait, when test on class, it is skipped https://getrector.com/demo/0ec3e640-7f26-4c5e-8a61-3441052f3c83 I guest type checking `\PHPStan\Type\ErrorType` or check inside trait should be added. Could you try provide...
The issue seems on `RemoveAlwaysTrueIfConditionRector` itself, on trait https://getrector.com/demo/0eeffa93-ebce-4f51-872c-1fb5319ac521
iirc, the preload is ensure the version rector php-parser use is the one from rector prefixed vendor, so even without patch, the order of rector preload still needed, except, in...
@TomasVotruba I am testing that add this check on `bootstrap.php` early: ```diff +if (defined('PHPUNIT_COMPOSER_INSTALL')) { + require_once __DIR__ . '/preload.php'; +} // inspired by https://github.com/phpstan/phpstan/blob/master/bootstrap.php spl_autoload_register(function (string $class): void {...
@TomasVotruba @staabm I created PR to try handle on `bootstrap.php` - https://github.com/rectorphp/rector-src/pull/7451 The logic can be more precise if needed.
@nikic @TomasVotruba I've applied fix 👍 Ready for review/merge 👍
@TomasVotruba I've moved test under `test/code/formatPreservation` directory https://github.com/nikic/PHP-Parser/pull/1125/commits/5e60691ef671a0299e1a63e9deffe08ee7ef7403 The patch seems still needs on token level tho as far as I can understand.
Ready for review 👍
@nikic could you share script to verify the benchmark? Thank you.
@nikic I created benchmark repo for non-cached vs cached node visitor version https://github.com/samsonasik/php-parser-with-cache-node-visitor-benchmark which shows faster result on total time.