-
Notifications
You must be signed in to change notification settings - Fork 471
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BooleanAndConstantConditionRule - check LogicalAnd (bleeding edge), u…
…se virtual node for more correct result
- Loading branch information
1 parent
9c39e0f
commit 40a76e8
Showing
7 changed files
with
96 additions
and
18 deletions.
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
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
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,55 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace PHPStan\Node; | ||
|
||
use PhpParser\Node\Expr\BinaryOp\BooleanAnd; | ||
use PhpParser\Node\Expr\BinaryOp\LogicalAnd; | ||
use PhpParser\NodeAbstract; | ||
use PHPStan\Analyser\Scope; | ||
|
||
class BooleanAndNode extends NodeAbstract implements VirtualNode | ||
{ | ||
|
||
/** @var BooleanAnd|LogicalAnd */ | ||
private $originalNode; | ||
|
||
private Scope $rightScope; | ||
|
||
/** | ||
* @param BooleanAnd|LogicalAnd $originalNode | ||
* @param Scope $rightScope | ||
*/ | ||
public function __construct($originalNode, Scope $rightScope) | ||
{ | ||
parent::__construct($originalNode->getAttributes()); | ||
$this->originalNode = $originalNode; | ||
$this->rightScope = $rightScope; | ||
} | ||
|
||
/** | ||
* @return BooleanAnd|LogicalAnd | ||
*/ | ||
public function getOriginalNode() | ||
{ | ||
return $this->originalNode; | ||
} | ||
|
||
public function getRightScope(): Scope | ||
{ | ||
return $this->rightScope; | ||
} | ||
|
||
public function getType(): string | ||
{ | ||
return 'PHPStan_Node_BooleanAndNode'; | ||
} | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
public function getSubNodeNames(): array | ||
{ | ||
return []; | ||
} | ||
|
||
} |
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