Skip to content

Commit

Permalink
NotIssetExpr -> IssetExpr
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Oct 31, 2023
1 parent 8c0eaf9 commit 4c4caab
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/Analyser/MutatingScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
use PHPStan\Node\Expr\PropertyInitializationExpr;
use PHPStan\Node\Expr\SetOffsetValueTypeExpr;
use PHPStan\Node\Expr\TypeExpr;
use PHPStan\Node\NotIssetExpr;
use PHPStan\Node\IssetExpr;
use PHPStan\Node\Printer\ExprPrinter;
use PHPStan\Parser\ArrayMapArgVisitor;
use PHPStan\Parser\NewAssignedToPropertyVisitor;
Expand Down Expand Up @@ -3823,7 +3823,7 @@ public function filterBySpecifiedTypes(SpecifiedTypes $specifiedTypes): self
$expr = $typeSpecification['expr'];
$type = $typeSpecification['type'];

if ($expr instanceof NotIssetExpr) {
if ($expr instanceof IssetExpr) {
$unsetExpr = $expr->getExpr();
$scope = $scope->unsetExpression($unsetExpr);

Expand Down
6 changes: 3 additions & 3 deletions src/Analyser/TypeSpecifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use PhpParser\Node\Expr\StaticPropertyFetch;
use PhpParser\Node\Name;
use PHPStan\Node\Expr\AlwaysRememberedExpr;
use PHPStan\Node\NotIssetExpr;
use PHPStan\Node\IssetExpr;
use PHPStan\Node\Printer\ExprPrinter;
use PHPStan\Reflection\Assertions;
use PHPStan\Reflection\ParametersAcceptor;
Expand Down Expand Up @@ -690,7 +690,7 @@ public function specifyTypesInCondition(

if ($isset === true && !TypeCombinator::containsNull($type)) {
$specifiedTypes = $specifiedTypes->unionWith($this->create(
new NotIssetExpr($var),
new IssetExpr($var),
new NullType(),
$context,
false,
Expand Down Expand Up @@ -757,7 +757,7 @@ public function specifyTypesInCondition(
$offsetType = $type->getOffsetValueType($dimType);
if ($hasOffsetType->yes() && !TypeCombinator::containsNull($offsetType)) {
$specifiedTypes = $specifiedTypes->unionWith($this->create(
new NotIssetExpr($var),
new IssetExpr($var),
new NullType(),
$context,
false,
Expand Down
4 changes: 2 additions & 2 deletions src/Node/NotIssetExpr.php → src/Node/IssetExpr.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use PhpParser\Node\Expr;

class NotIssetExpr extends Expr implements VirtualNode
class IssetExpr extends Expr implements VirtualNode
{

public function __construct(
Expand All @@ -21,7 +21,7 @@ public function getExpr(): Expr

public function getType(): string
{
return 'PHPStan_Node_NotIssetExpr';
return 'PHPStan_Node_IssetExpr';
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/Node/Printer/Printer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use PHPStan\Node\Expr\PropertyInitializationExpr;
use PHPStan\Node\Expr\SetOffsetValueTypeExpr;
use PHPStan\Node\Expr\TypeExpr;
use PHPStan\Node\NotIssetExpr;
use PHPStan\Node\IssetExpr;
use PHPStan\Type\VerbosityLevel;
use function sprintf;

Expand Down Expand Up @@ -58,9 +58,9 @@ protected function pPHPStan_Node_PropertyInitializationExpr(PropertyInitializati
return sprintf('__phpstanPropertyInitialization(%s)', $expr->getPropertyName());
}

protected function pPHPStan_Node_NotIssetExpr(NotIssetExpr $expr): string // phpcs:ignore
protected function pPHPStan_Node_IssetExpr(IssetExpr $expr): string // phpcs:ignore
{
return sprintf('__phpstanNotIssetExpr(%s)', $this->p($expr->getExpr()));
return sprintf('__phpstanIssetExpr(%s)', $this->p($expr->getExpr()));
}

}

0 comments on commit 4c4caab

Please sign in to comment.