Skip to content

Commit 7c34cfe

Browse files
committed
Updated Rector to commit 083c72809d8a31a3c618e4002d79b959c5888364
rectorphp/rector-src@083c728 [dx] warn about deprecated beforeTraverse() method once FileNode is ready (#7768)
1 parent ae6aa7c commit 7c34cfe

File tree

6 files changed

+30
-11
lines changed

6 files changed

+30
-11
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 = 'e39c3e1250194f9eaacf34c78c8e951c84f26222';
22+
public const PACKAGE_VERSION = '083c72809d8a31a3c618e4002d79b959c5888364';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2025-12-22 08:56:31';
27+
public const RELEASE_DATE = '2025-12-22 14:27:18';
2828
/**
2929
* @var int
3030
*/

src/Console/Command/ProcessCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
189189
$this->deprecatedRulesReporter->reportDeprecatedRules();
190190
$this->deprecatedRulesReporter->reportDeprecatedSkippedRules();
191191
$this->deprecatedRulesReporter->reportDeprecatedNodeTypes();
192+
$this->deprecatedRulesReporter->reportDeprecatedRectorUnsupportedMethods();
192193
$this->missConfigurationReporter->reportSkippedNeverRegisteredRules();
193194
return $this->resolveReturnCode($processResult, $configuration);
194195
}

src/Reporting/DeprecatedRulesReporter.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
declare (strict_types=1);
44
namespace Rector\Reporting;
55

6+
use Rector\PhpParserNode\FileNode;
67
use Rector\Configuration\Deprecation\Contract\DeprecatedInterface;
78
use Rector\Configuration\Option;
89
use Rector\Configuration\Parameter\SimpleParameterProvider;
910
use Rector\Contract\PhpParser\Node\StmtsAwareInterface;
1011
use Rector\Contract\Rector\RectorInterface;
1112
use Rector\PhpParser\Enum\NodeGroup;
13+
use ReflectionMethod;
1214
use RectorPrefix202512\Symfony\Component\Console\Style\SymfonyStyle;
1315
final class DeprecatedRulesReporter
1416
{
@@ -51,6 +53,22 @@ public function reportDeprecatedSkippedRules(): void
5153
$this->symfonyStyle->warning(sprintf('Skipped rule "%s" is deprecated', $skippedRectorRule));
5254
}
5355
}
56+
public function reportDeprecatedRectorUnsupportedMethods(): void
57+
{
58+
// to be added in related PR
59+
if (!class_exists(FileNode::class)) {
60+
return;
61+
}
62+
foreach ($this->rectors as $rector) {
63+
$beforeTraverseMethodReflection = new ReflectionMethod($rector, 'beforeTraverse');
64+
if (\PHP_VERSION_ID < 80100) {
65+
$beforeTraverseMethodReflection->setAccessible(\true);
66+
}
67+
if ($beforeTraverseMethodReflection->getDeclaringClass()->getName() === get_class($rector)) {
68+
$this->symfonyStyle->warning(sprintf('Rector rule "%s" uses deprecated "beforeTraverse" method. It should not be used, as will be marked as final. Not part of RectorInterface contract. Use "%s" to hook into file-level changes instead.', get_class($rector), FileNode::class));
69+
}
70+
}
71+
}
5472
public function reportDeprecatedNodeTypes(): void
5573
{
5674
// helper property to avoid reporting multiple times

vendor/composer/installed.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -625,17 +625,17 @@
625625
},
626626
{
627627
"name": "nette\/utils",
628-
"version": "v4.1.0",
629-
"version_normalized": "4.1.0.0",
628+
"version": "v4.1.1",
629+
"version_normalized": "4.1.1.0",
630630
"source": {
631631
"type": "git",
632632
"url": "https:\/\/github.com\/nette\/utils.git",
633-
"reference": "fa1f0b8261ed150447979eb22e373b7b7ad5a8e0"
633+
"reference": "c99059c0315591f1a0db7ad6002000288ab8dc72"
634634
},
635635
"dist": {
636636
"type": "zip",
637-
"url": "https:\/\/api.github.com\/repos\/nette\/utils\/zipball\/fa1f0b8261ed150447979eb22e373b7b7ad5a8e0",
638-
"reference": "fa1f0b8261ed150447979eb22e373b7b7ad5a8e0",
637+
"url": "https:\/\/api.github.com\/repos\/nette\/utils\/zipball\/c99059c0315591f1a0db7ad6002000288ab8dc72",
638+
"reference": "c99059c0315591f1a0db7ad6002000288ab8dc72",
639639
"shasum": ""
640640
},
641641
"require": {
@@ -659,7 +659,7 @@
659659
"ext-mbstring": "to use Strings::lower() etc...",
660660
"ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()"
661661
},
662-
"time": "2025-12-01T17:49:23+00:00",
662+
"time": "2025-12-22T12:14:32+00:00",
663663
"type": "library",
664664
"extra": {
665665
"branch-alias": {
@@ -711,7 +711,7 @@
711711
],
712712
"support": {
713713
"issues": "https:\/\/github.com\/nette\/utils\/issues",
714-
"source": "https:\/\/github.com\/nette\/utils\/tree\/v4.1.0"
714+
"source": "https:\/\/github.com\/nette\/utils\/tree\/v4.1.1"
715715
},
716716
"install-path": "..\/nette\/utils"
717717
},

vendor/composer/installed.php

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

vendor/nette/utils/src/Utils/Html.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ final public function addHtml($child)
524524
}
525525
/**
526526
* Appends plain-text string to element content.
527-
* @param \Stringable|string $text
527+
* @param \Stringable|string|int|null $text
528528
* @return static
529529
*/
530530
public function addText($text)

0 commit comments

Comments
 (0)