Skip to content

Commit 14cd108

Browse files
committed
Updated Rector to commit f366a7e66228f35dc877e816b553c4f38332f801
rectorphp/rector-src@f366a7e [DX] add notifyWithPhpSetsNotSuitableForPHP80() (#5988)
1 parent 8453ac2 commit 14cd108

3 files changed

Lines changed: 14 additions & 5 deletions

File tree

src/Application/VersionResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ final class VersionResolver
1919
* @api
2020
* @var string
2121
*/
22-
public const PACKAGE_VERSION = 'afdf525d46e29655076253ec8d35e780cadd1be2';
22+
public const PACKAGE_VERSION = 'f366a7e66228f35dc877e816b553c4f38332f801';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2024-06-20 15:17:54';
27+
public const RELEASE_DATE = '2024-06-20 13:21:54';
2828
/**
2929
* @var int
3030
*/

src/Configuration/RectorConfigBuilder.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,8 @@ public function withPhpPolyfill() : self
346346
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
347347
{
348348
$pickedArguments = \array_filter(\func_get_args());
349-
if ($pickedArguments !== [] && \PHP_VERSION_ID < 80000) {
350-
echo \sprintf('The "withPhpSets()" method uses named arguments. Its suitable for PHP 8.0+. In lower PHP versions, use withPhp53Sets() ... withPhp74Sets() method instead. One at a time.%sTo use your composer.json PHP version, keep arguments of this method.', \PHP_EOL);
351-
\sleep(3);
349+
if ($pickedArguments !== []) {
350+
Notifier::notifyWithPhpSetsNotSuitableForPHP80();
352351
}
353352
if (\count($pickedArguments) > 1) {
354353
throw new InvalidConfigurationException(\sprintf('Pick only one version target in "withPhpSets()". All rules up to this version will be used.%sTo use your composer.json PHP version, keep arguments empty.', \PHP_EOL));

src/Console/Notifier.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,14 @@ public static function notifyNotSuitableMethodForPHP80(string $calledMethod, str
2929
$symfonyStyle->warning($message);
3030
\sleep(3);
3131
}
32+
public static function notifyWithPhpSetsNotSuitableForPHP80() : void
33+
{
34+
if (\PHP_VERSION_ID >= 80000) {
35+
return;
36+
}
37+
$message = \sprintf('The "withPhpSets()" method uses named arguments. Its suitable for PHP 8.0+. In lower PHP versions, use withPhp53Sets() ... withPhp74Sets() method instead. One at a time.%sTo use your composer.json PHP version, keep arguments of this method.', \PHP_EOL);
38+
$symfonyStyle = new SymfonyStyle(new ArgvInput(), new ConsoleOutput());
39+
$symfonyStyle->warning($message);
40+
\sleep(3);
41+
}
3242
}

0 commit comments

Comments
 (0)