Skip to content

Commit

Permalink
[TypeDeclaration] Skip param setter method intersection docblock not …
Browse files Browse the repository at this point in the history
…autoload on ReturnNeverTypeRector (#4721)

* Add test-case for #8121

* Closes #4717 Fixes rectorphp/rector#8121

---------

Co-authored-by: Matthias Krauser <matthias@krauser.eu>
  • Loading branch information
samsonasik and mkrauser committed Aug 8, 2023
1 parent 0a8ffe3 commit 17fe187
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector\Fixture;

final class SkipSettersParamIntersectionDocblockNotAutoload
{
/**
* @param Type&Parts[] $value
*/
public function setter($value): void
{
$this->prop = $value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ private function hasNeverFuncCall(ClassMethod | Closure | Function_ $functionLik
continue;
}

$stmtType = $this->getType($stmt);
$stmtType = $this->nodeTypeResolver->getNativeType($stmt);
if ($stmtType instanceof NeverType) {
$hasNeverType = true;
}
Expand Down

0 comments on commit 17fe187

Please sign in to comment.