Skip to content

Commit

Permalink
[Php81] Skip $this::class on trait on NullToStrictStringFuncCallArgRe…
Browse files Browse the repository at this point in the history
…ctor (#5732)
  • Loading branch information
samsonasik committed Mar 17, 2024
1 parent 1764c19 commit ac2bd3f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace Rector\Tests\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector\Fixture;

trait SkipClassStringOnTrait
{
public function run(string $param)
{
return str_replace($param, '', $this::class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ private function shouldSkipTrait(Expr $expr, Type $type, bool $isTrait): bool
return false;
}

if ($type instanceof ErrorType) {
return true;
}

if ($type->isExplicitMixed()) {
return false;
}
Expand Down

0 comments on commit ac2bd3f

Please sign in to comment.