From 24e1aacac41735a02854e707085edc48f386a48b Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Fri, 27 Dec 2024 15:39:44 +0000 Subject: [PATCH] Updated Rector to commit 7bbe9ba2af41fbb64a2817cd44d19665aa79f186 https://github.com/rectorphp/rector-src/commit/7bbe9ba2af41fbb64a2817cd44d19665aa79f186 [DX] Warn about ->withPhpSets() called multiple times, to avoid invalid set mix (#6632) --- src/Application/VersionResolver.php | 4 ++-- src/Configuration/RectorConfigBuilder.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index b83618e52b1..398942f1e6a 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = '5f21af7a492f8be43972c1d89fa150ae9e37475c'; + public const PACKAGE_VERSION = '7bbe9ba2af41fbb64a2817cd44d19665aa79f186'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-12-27 20:20:25'; + public const RELEASE_DATE = '2024-12-27 16:37:19'; /** * @var int */ diff --git a/src/Configuration/RectorConfigBuilder.php b/src/Configuration/RectorConfigBuilder.php index 4f048f0532f..2be0a4d1380 100644 --- a/src/Configuration/RectorConfigBuilder.php +++ b/src/Configuration/RectorConfigBuilder.php @@ -120,9 +120,6 @@ final class RectorConfigBuilder */ private array $groupLoadedSets = []; private ?string $editorUrl = null; - /** - * @api soon to be used - */ private ?bool $isWithPhpSetsUsed = null; private ?bool $isWithPhpLevelUsed = null; public function __invoke(RectorConfig $rectorConfig) : void @@ -369,6 +366,9 @@ public function withPhpPolyfill() : self */ public function withPhpSets(bool $php83 = \false, bool $php82 = \false, bool $php81 = \false, bool $php80 = \false, bool $php74 = \false, bool $php73 = \false, bool $php72 = \false, bool $php71 = \false, bool $php70 = \false, bool $php56 = \false, bool $php55 = \false, bool $php54 = \false, bool $php53 = \false, bool $php84 = \false) : self { + if ($this->isWithPhpSetsUsed === \true) { + throw new InvalidConfigurationException(\sprintf('Method "%s()" can be called only once. It always includes all previous sets UP TO the defined version.%sThe best practise is to call it once with no argument. That way it will pick up PHP version from composer.json and your project will always stay up to date.', __METHOD__, \PHP_EOL)); + } $this->isWithPhpSetsUsed = \true; $pickedArguments = \array_filter(\func_get_args()); if ($pickedArguments !== []) {