John Davidson

php - Don't import classes on specific path in rectorphp/rector

0 comments
Message:


I have a rector setup for upgrading to laravel9 and php8.1, and it works good.


My question is, how to set up the config so that it imports the classes everywhere, but not in config/app.php?


return static function (RectorConfig $rectorConfig): void {
$rectorConfig->parallel(seconds: 240, maxNumberOfProcess: 6);

$rectorConfig->paths([
__DIR__ . '/app',
__DIR__ . '/bootstrap/app.php',
__DIR__ . '/config',
__DIR__ . '/database',
__DIR__ . '/lang',
__DIR__ . '/resources',
__DIR__ . '/routes',
__DIR__ . '/tests',
]);

$rectorConfig->importNames();
$rectorConfig->importShortClasses(false);

...

I'm avare of skip(), but that seems to work for files or rules, not config parameters...



My Answer:
t forget to end your PHP code with a closing tag, like so:

php
// Your PHP code here
?>

Rate this post

4 of 5 based on 8311 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us