Skip to content

Commit

Permalink
Remove irrelevant types, use keep aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
hamburnyog committed Oct 5, 2022
1 parent 04c9fe8 commit ae426a0
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 141 deletions.
21 changes: 3 additions & 18 deletions src/Psalm/Type/Atomic.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
use Psalm\Type\Atomic\TLowercaseString;
use Psalm\Type\Atomic\TMixed;
use Psalm\Type\Atomic\TNamedObject;
use Psalm\Type\Atomic\TNegativeInt;
use Psalm\Type\Atomic\TNever;
use Psalm\Type\Atomic\TNonEmptyArray;
use Psalm\Type\Atomic\TNonEmptyList;
Expand All @@ -55,8 +54,6 @@
use Psalm\Type\Atomic\TNonEmptyScalar;
use Psalm\Type\Atomic\TNonEmptyString;
use Psalm\Type\Atomic\TNonFalsyString;
use Psalm\Type\Atomic\TNonNegativeInt;
use Psalm\Type\Atomic\TNonPositiveInt;
use Psalm\Type\Atomic\TNonspecificLiteralInt;
use Psalm\Type\Atomic\TNonspecificLiteralString;
use Psalm\Type\Atomic\TNull;
Expand Down Expand Up @@ -234,13 +231,13 @@ public static function create(
return new TPositiveInt();

case 'non-positive-int':
return new TNonPositiveInt();
return new TIntRange(null, -1);

case 'negative-int':
return new TNegativeInt();
return new TIntRange(null, -1);

case 'non-negative-int':
return new TNonNegativeInt();
return new TPositiveInt();

case 'numeric':
return $php_version !== null ? new TNamedObject($value) : new TNumeric();
Expand Down Expand Up @@ -732,18 +729,6 @@ public function isTruthy(): bool
return true;
}

if ($this instanceof TNonPositiveInt) {
return true;
}

if ($this instanceof TNegativeInt) {
return true;
}

if ($this instanceof TNonNegativeInt) {
return true;
}

if ($this instanceof TLiteralClassString) {
return true;
}
Expand Down
41 changes: 0 additions & 41 deletions src/Psalm/Type/Atomic/TNegativeInt .php

This file was deleted.

41 changes: 0 additions & 41 deletions src/Psalm/Type/Atomic/TNonNegativeInt.php

This file was deleted.

41 changes: 0 additions & 41 deletions src/Psalm/Type/Atomic/TNonPositiveInt.php

This file was deleted.

0 comments on commit ae426a0

Please sign in to comment.