-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement TypeSpecifierComparisonContext
- Loading branch information
Showing
5 changed files
with
205 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace PHPStan\Analyser; | ||
|
||
use PhpParser\Node\Expr; | ||
use PhpParser\Node\Expr\BinaryOp; | ||
use PhpParser\Node\Expr\CallLike; | ||
use PHPStan\Type\Type; | ||
|
||
/** @api */ | ||
final class TypeSpecifierComparisonContext | ||
{ | ||
|
||
public function __construct( | ||
private BinaryOp $binaryOp, | ||
private Expr $callExpr, | ||
private CallLike $callLike, | ||
private Type $comparisonType, | ||
private TypeSpecifierContext $context, | ||
private ?Expr $rootExpr, | ||
) | ||
{ | ||
} | ||
|
||
public function getBinaryOp(): BinaryOp | ||
{ | ||
return $this->binaryOp; | ||
} | ||
|
||
public function getCallExpr(): Expr | ||
{ | ||
return $this->callExpr; | ||
} | ||
|
||
public function getCallLike(): CallLike | ||
{ | ||
return $this->callLike; | ||
} | ||
|
||
public function getComparisonType(): Type | ||
{ | ||
return $this->comparisonType; | ||
} | ||
|
||
public function getTypeSpecifierContext(): TypeSpecifierContext | ||
{ | ||
return $this->context; | ||
} | ||
|
||
public function getRootExpr(): ?Expr | ||
{ | ||
return $this->rootExpr; | ||
} | ||
|
||
} |
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