Skip to content

Commit

Permalink
skip attributed class method
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed May 21, 2024
1 parent 608f144 commit 112c5ca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Rules/NoReturnSetterMethodRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\NodeTraverser;
use PHPStan\Analyser\Scope;
use PHPStan\Reflection\ClassReflection;
use PHPStan\Rules\Rule;
use Symplify\PHPStanRules\NodeFinder\TypeAwareNodeFinder;
use Symplify\PHPStanRules\NodeVisitor\HasScopedReturnNodeVisitor;
Expand Down Expand Up @@ -53,6 +52,11 @@ public function getNodeType(): string
*/
public function processNode(Node $node, Scope $scope): array
{
// possibly some important logic
if ($node->attrGroups !== []) {
return [];
}

$classReflection = $scope->getClassReflection();
if (! $classReflection->isClass()) {
return [];
Expand Down

0 comments on commit 112c5ca

Please sign in to comment.