-
Notifications
You must be signed in to change notification settings - Fork 449
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e9ef210
commit 657fc54
Showing
2 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace PHPStan\Node; | ||
|
||
use PhpParser\Node; | ||
use PHPStan\Reflection\ClassReflection; | ||
|
||
/** @api */ | ||
class InTraitNode extends Node\Stmt implements VirtualNode | ||
{ | ||
|
||
public function __construct(private Node\Stmt\Trait_ $originalNode, private ClassReflection $traitReflection) | ||
{ | ||
parent::__construct($originalNode->getAttributes()); | ||
} | ||
|
||
public function getOriginalNode(): Node\Stmt\Trait_ | ||
{ | ||
return $this->originalNode; | ||
} | ||
|
||
public function getTraitReflection(): ClassReflection | ||
{ | ||
return $this->traitReflection; | ||
} | ||
|
||
public function getType(): string | ||
{ | ||
return 'PHPStan_Stmt_InTraitNode'; | ||
} | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
public function getSubNodeNames(): array | ||
{ | ||
return []; | ||
} | ||
|
||
} |
657fc54
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this addition mean, we can now build rules to analyze traits without analyzing them in context of their used class?
657fc54
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No :)