Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Dec 30, 2021
1 parent a0c7353 commit c4b25ff
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Rector\Tests\DowngradePhp80\Rector\FuncCall\DowngradeArrayFilterNullableCallbackRector\Fixture;

class SkipStringFunctionNameSecondArg
{
public function run(array $data)
{
$result = array_filter($data, 'strlen' );
}
}

?>
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,12 @@ public function refactor(Node $node): ?FuncCall
}

$type = $this->nodeTypeResolver->getType($args[1]->value);

// need exact compare null to handle variable
if ($this->valueResolver->isNull($args[1]->value) || ! $type instanceof MixedType) {
if (! $this->valueResolver->isNull($args[1]->value)) {
return null;
}

if (! $type instanceof MixedType) {
return null;
}

Expand Down

0 comments on commit c4b25ff

Please sign in to comment.