Skip to content
Merged
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
9 changes: 9 additions & 0 deletions bin/rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Rector\Bootstrap\RectorConfigsResolver;
use Rector\ChangesReporting\Output\JsonOutputFormatter;
use Rector\Configuration\Option;
use Rector\Configuration\Parameter\SimpleParameterProvider;
use Rector\Console\Style\SymfonyStyleFactory;
use Rector\DependencyInjection\LazyContainerFactory;
use Rector\DependencyInjection\RectorContainerFactory;
Expand Down Expand Up @@ -127,6 +128,14 @@ public function loadIfExistsAndNotLoadedYet(string $filePath): void
$autoloadIncluder->autoloadRectorInstalledAsGlobalDependency();
$autoloadIncluder->autoloadFromCommandLine();

// a different extra autoload changes what PHPStan can resolve, so cached results
// must not survive it: register it before the configuration hash is computed.
// ArgvInput handles both "--autoload-file path" and "--autoload-file=path"
$autoloadFileOption = (new ArgvInput())->getParameterOption(['--autoload-file', '-a'], null);
if (is_string($autoloadFileOption) && $autoloadFileOption !== '') {
SimpleParameterProvider::setParameter(Option::AUTOLOAD_FILE, realpath($autoloadFileOption) ?: $autoloadFileOption);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, where is this Option::AUTOLOAD_FILE parameter used later?

@SanderMuller SanderMuller Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nowhere directly — it only feeds SimpleParameterProvider::hash(), which FileHashComputer folds into the configuration hash. So a different -a changes that hash and the cache clears at boot, same as editing rector.php.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it 👍

Btw, feels like I'm talking to chatbot, it's very hard to process these long responses.
Lots of unnecessary clutter, unrelated methods, links to decipher. Human response would be better :D

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, will slow down a bit with the AI replies, although Fable 5 is quite trigger happy with these, more so than previous models, now need to actually instruct it NOT to do it where in the past you have to tell it to do it explicitly

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, but we're not :D I don't want to turn this codebase into an AI slop. So far it costs more attention than it brings value.

}

$rectorConfigsResolver = new RectorConfigsResolver();

try {
Expand Down
Loading