Skip to content

Commit

Permalink
Updated Rector to commit 863a5ed69a150aed2c87038ef35421ee1626abd3
Browse files Browse the repository at this point in the history
rectorphp/rector-src@863a5ed [DX] Depreate heavy and conflicting Symfony/Twig/PHPUnit level sets (#5477)
  • Loading branch information
TomasVotruba committed Jan 17, 2024
1 parent ee75e1d commit d67d565
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '985d5ea5109e1282f35370006ad7ac26df7789de';
public const PACKAGE_VERSION = '863a5ed69a150aed2c87038ef35421ee1626abd3';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-01-17 15:36:14';
public const RELEASE_DATE = '2024-01-17 18:37:42';
/**
* @var int
*/
Expand Down
17 changes: 17 additions & 0 deletions src/Config/RectorConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
use Rector\ValueObject\PhpVersion;
use Rector\ValueObject\PolyfillPackage;
use RectorPrefix202401\Symfony\Component\Console\Command\Command;
use RectorPrefix202401\Symfony\Component\Console\Input\ArrayInput;
use RectorPrefix202401\Symfony\Component\Console\Output\ConsoleOutput;
use RectorPrefix202401\Symfony\Component\Console\Style\SymfonyStyle;
use RectorPrefix202401\Webmozart\Assert\Assert;
/**
* @api
Expand Down Expand Up @@ -56,6 +59,20 @@ public function sets(array $sets) : void
Assert::fileExists($set);
$this->import($set);
}
// notify about deprecated sets
foreach ($sets as $set) {
if (\strpos($set, 'deprecated-level-set') === \false) {
continue;
}
// display only on main command run, skip spamming in workers
$commandArguments = $_SERVER['argv'];
if (!\in_array('worker', $commandArguments, \true)) {
// show warning, to avoid confusion
$symfonyStyle = new SymfonyStyle(new ArrayInput([]), new ConsoleOutput());
$symfonyStyle->warning("The Symfony/Twig/PHPUnit level sets have been deprecated since Rector 0.19.2 due to heavy performance loads and conflicting overrides. Instead, please use the latest major set.\n\nFor more information, visit https://getrector.com/blog/5-common-mistakes-in-rector-config-and-how-to-avoid-them");
break;
}
}
// for cache invalidation in case of sets change
SimpleParameterProvider::addParameter(Option::REGISTERED_RECTOR_SETS, $sets);
}
Expand Down
2 changes: 1 addition & 1 deletion vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -1855,7 +1855,7 @@
"description": "Rector upgrades rules for PHPUnit",
"support": {
"issues": "https:\/\/github.com\/rectorphp\/rector-phpunit\/issues",
"source": "https:\/\/github.com\/rectorphp\/rector-phpunit\/tree\/main"
"source": "https:\/\/github.com\/rectorphp\/rector-phpunit\/tree\/0.19.1"
},
"install-path": "..\/rector\/rector-phpunit"
},
Expand Down

0 comments on commit d67d565

Please sign in to comment.