Skip to content

Commit d5a6bce

Browse files
committed
Updated Rector to commit 07dc58043d4a4634e6376094af98a3233719a2da
rectorphp/rector-src@07dc580 Run with*Sets() notifications only on PHP 8.0 to avoid true/false/false/true configs (#5993)
1 parent 1951a60 commit d5a6bce

File tree

3 files changed

+7
-30
lines changed

3 files changed

+7
-30
lines changed

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 = '6b11f63e63fc75ea80a4ee609f3e175863305b6f';
22+
public const PACKAGE_VERSION = '07dc58043d4a4634e6376094af98a3233719a2da';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2024-06-21 02:25:42';
27+
public const RELEASE_DATE = '2024-06-21 02:28:40';
2828
/**
2929
* @var int
3030
*/

src/Configuration/RectorConfigBuilder.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -422,58 +422,52 @@ public function withPhpSets(bool $php83 = \false, bool $php82 = \false, bool $ph
422422
}
423423
return $this;
424424
}
425-
// suitable for PHP 7.4 and lower, before named args
425+
/**
426+
* Following methods are suitable for PHP 7.4 and lower, before named args
427+
* Let's keep them without warning, in case Rector is run on both PHP 7.4 and PHP 8.0 in CI
428+
*/
426429
public function withPhp53Sets() : self
427430
{
428-
Notifier::notifyNotSuitableMethodForPHP80(__METHOD__);
429431
$this->sets[] = LevelSetList::UP_TO_PHP_53;
430432
return $this;
431433
}
432434
public function withPhp54Sets() : self
433435
{
434-
Notifier::notifyNotSuitableMethodForPHP80(__METHOD__);
435436
$this->sets[] = LevelSetList::UP_TO_PHP_54;
436437
return $this;
437438
}
438439
public function withPhp55Sets() : self
439440
{
440-
Notifier::notifyNotSuitableMethodForPHP80(__METHOD__);
441441
$this->sets[] = LevelSetList::UP_TO_PHP_55;
442442
return $this;
443443
}
444444
public function withPhp56Sets() : self
445445
{
446-
Notifier::notifyNotSuitableMethodForPHP80(__METHOD__);
447446
$this->sets[] = LevelSetList::UP_TO_PHP_56;
448447
return $this;
449448
}
450449
public function withPhp70Sets() : self
451450
{
452-
Notifier::notifyNotSuitableMethodForPHP80(__METHOD__);
453451
$this->sets[] = LevelSetList::UP_TO_PHP_70;
454452
return $this;
455453
}
456454
public function withPhp71Sets() : self
457455
{
458-
Notifier::notifyNotSuitableMethodForPHP80(__METHOD__);
459456
$this->sets[] = LevelSetList::UP_TO_PHP_71;
460457
return $this;
461458
}
462459
public function withPhp72Sets() : self
463460
{
464-
Notifier::notifyNotSuitableMethodForPHP80(__METHOD__);
465461
$this->sets[] = LevelSetList::UP_TO_PHP_72;
466462
return $this;
467463
}
468464
public function withPhp73Sets() : self
469465
{
470-
Notifier::notifyNotSuitableMethodForPHP80(__METHOD__);
471466
$this->sets[] = LevelSetList::UP_TO_PHP_73;
472467
return $this;
473468
}
474469
public function withPhp74Sets() : self
475470
{
476-
Notifier::notifyNotSuitableMethodForPHP80(__METHOD__);
477471
$this->sets[] = LevelSetList::UP_TO_PHP_74;
478472
return $this;
479473
}

src/Console/Notifier.php

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,12 @@ public static function notifyNotSuitableMethodForPHP74(string $calledMethod) : v
1818
$symfonyStyle->warning($message);
1919
\sleep(3);
2020
}
21-
public static function notifyNotSuitableMethodForPHP80(string $calledMethod) : void
22-
{
23-
// current project version check
24-
if (\PHP_VERSION_ID < 80000) {
25-
return;
26-
}
27-
$message = \sprintf('The "%s()" method is suitable for PHP 7.4 and lower. Use the following methods instead:
28-
29-
- "withPhpSets()" in PHP 8.0+
30-
- "withSets([...])" for use in both php ^7.2 and php 8.0+.', $calledMethod);
31-
$symfonyStyle = new SymfonyStyle(new ArgvInput(), new ConsoleOutput());
32-
$symfonyStyle->warning($message);
33-
\sleep(3);
34-
}
3521
public static function notifyWithPhpSetsNotSuitableForPHP80() : void
3622
{
3723
if (\PHP_VERSION_ID >= 80000) {
3824
return;
3925
}
40-
$message = 'The "withPhpSets()" method uses named arguments. Its suitable for PHP 8.0+. Use the following methods instead:
41-
42-
- "withPhp53Sets()" ... "withPhp74Sets()" in lower PHP versions
43-
- "withSets([...])" for use both PHP ^7.2 and php 8.0+.';
26+
$message = 'The "withPhpSets()" method uses named arguments. Its suitable for PHP 8.0+. Use more explicit "withPhp53Sets()" ... "withPhp74Sets()" in lower PHP versions instead.';
4427
$symfonyStyle = new SymfonyStyle(new ArgvInput(), new ConsoleOutput());
4528
$symfonyStyle->warning($message);
4629
\sleep(3);

0 commit comments

Comments
 (0)