-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Rector] Update rector to ^0.10 #4468
Conversation
Hi @TomasVotruba , I tried to update vendor/bin/rector process system/CLI/BaseCommand.php --dry-run
Could not process "system/CLI/BaseCommand.php" file, due to:
"Analyze error: "Error (Call to undefined function CodeIgniter\CLI\is_cli()) thrown while looking for class
CodeIgniter\CLI\CLI.". Include your files in "$parameters->set(Option::AUTOLOAD_PATHS, [...]);" in "rector.php"
config.
See https://github.com/rectorphp/rector#configuration". The // Rector relies on autoload setup of your project; Composer autoload is included by default; to add more:
$parameters->set(Option::AUTOLOAD_PATHS, [
// autoload specific file
__DIR__ . '/system/Test/bootstrap.php',
]); even if I tried manually add // Rector relies on autoload setup of your project; Composer autoload is included by default; to add more:
$parameters->set(Option::AUTOLOAD_PATHS, [
// autoload specific file
__DIR__ . '/system/Test/bootstrap.php',
__DIR__ . '/system/Common.php',
]); it still got above notice, any idea to resolve it? Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like some work yet to be done here, but I would be glad to see us on the latest.
I'm looking into this. I tried to isolate the code but there is too many other packages. It seems it fails on this minimal code: use CodeIgniter\CLI\CLI;
class SomeClass
{
public function showHelp()
{
CLI::write('...');
}
} class CLI
{
public static function init()
{
return is_cli();
}
}
// this is called for some reason
CLI::init(); Could you create minimal reproducible repository? |
I will try |
@TomasVotruba I created a minimal repo that show that the autoload file with code https://github.com/samsonasik/rector-issue-010-autoload Somehow, the die('stop here'); in top of In rector |
@TomasVotruba I created rector issue for it rectorphp/rector#5951 |
@TomasVotruba I found temporary solution by add : require_once __DIR__ . '/system/Test/bootstrap.php'; outside rector config 1eb86d8 to ensure require_once loaded. |
All green 🎉 |
@samsonasik This should help rectorphp/rector#5964 |
@TomasVotruba thank you 👍 |
Checklist: