Skip to content

Commit 1543cbe

Browse files
authored
Optimize node type verification (#353)
* dev * misc
1 parent be93b16 commit 1543cbe

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"phpstan/phpstan": "^2.1.32",
1212
"phpstan/phpstan-webmozart-assert": "^2.0",
1313
"phpunit/phpunit": "^11.5",
14-
"rector/rector-src": "dev-main",
14+
"rector/rector-src": "dev-tv-traverse-optimize",
1515
"rector/type-perfect": "^2.1",
1616
"symplify/easy-coding-standard": "^12.3",
1717
"symplify/phpstan-extensions": "^12.0",

rules/DowngradePhp73/Rector/ConstFetch/DowngradePhp73JsonConstRector.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ private function hasConstFetchInArgs(array $args, string $constName): bool
201201
{
202202
foreach ($args as $arg) {
203203
$value = $arg->value;
204-
205-
if ($value instanceof ConstFetch && $this->getName($value) === $constName) {
204+
if ($value instanceof ConstFetch && $this->isName($value, $constName)) {
206205
return true;
207206
}
208207

tests/Issues/DowngradeNullJson/Fixture/fixture.php.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Fixture
2222
{
2323
public function run(?int $flags = null)
2424
{
25-
$flags = $flags ?? JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_PRESERVE_ZERO_FRACTION;
25+
$flags = $flags ?? JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_PRESERVE_ZERO_FRACTION | 0;
2626

2727
json_encode([], $flags);
2828
}

0 commit comments

Comments
 (0)