We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e8fc24 commit b88b582Copy full SHA for b88b582
1 file changed
rules/Php83/Rector/BooleanAnd/JsonValidateRector.php
@@ -4,6 +4,7 @@
4
5
namespace Rector\Php83\Rector\BooleanAnd;
6
7
+use PhpParser\Node\Identifier;
8
use PhpParser\Node;
9
use PhpParser\Node\Arg;
10
use PhpParser\Node\Expr\BinaryOp\BooleanAnd;
@@ -98,8 +99,8 @@ public function refactor(Node $node): ?Node
98
99
// Remove associative argument (position 1 or named) - json_validate does not have this param
100
foreach ($args as $index => $arg) {
101
if ($arg instanceof Arg && (
- ($arg->name !== null && $arg->name->toString() === 'associative') ||
102
- ($arg->name === null && $index === 1)
+ ($arg->name instanceof Identifier && $arg->name->toString() === 'associative') ||
103
+ (!$arg->name instanceof Identifier && $index === 1)
104
)) {
105
unset($funcCall->args[$index]);
106
break;
0 commit comments