Skip to content

Conversation

@samsonasik
Copy link
Member

@samsonasik samsonasik commented Oct 11, 2025

@TomasVotruba this is my original alternative solution which previously you closed it at:

with check inside AbstractLazyTestCase instead of global bootstrap.php that included on composer.json -> files.

This to cover:

This is safer, with the following reason:

  • Doesn't enforce load our preload.php when it doesn't run rector phpunit
  • Only load preload.php on phpunit < 12, when on PHPUnit >=12, the preload already checked, since classmap is loaded by next check

if (\file_exists(__DIR__ . '/../../../vendor/scoper-autoload.php')) {
require_once __DIR__ . '/../../../vendor/scoper-autoload.php';
}

  • Rector bin already use it in bin/rector.php, so unrelated to it

rector-src/bin/rector.php

Lines 116 to 118 in d0866a8

if (file_exists(__DIR__ . '/../preload.php') && is_dir(__DIR__ . '/../vendor')) {
require_once __DIR__ . '/../preload.php';
}

@samsonasik
Copy link
Member Author

We can verify preload-split-package.php when we require PHPUnit 12 on rector-* packages, only on use of main preload.php for now.

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@TomasVotruba
Copy link
Member

Let's give it a go then 👍

@TomasVotruba TomasVotruba merged commit 2df5ab0 into main Oct 11, 2025
53 checks passed
@TomasVotruba TomasVotruba deleted the fix-autoload branch October 11, 2025 10:55
@samsonasik
Copy link
Member Author

samsonasik commented Oct 11, 2025

/cc @nikophil you should can use bamarni/composer-bin-plugin again by this on next rector release :)

try dev-main

@samsonasik
Copy link
Member Author

@TomasVotruba wait, just tested on laminas/laminas-servicemanager-migration and it seems cause issue as StmtsAwareInterface not detected ...

@samsonasik
Copy link
Member Author

@TomasVotruba I will add some check...

@samsonasik
Copy link
Member Author

I create new PR:

to cover both global and local autoload

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants