Skip to content

Commit

Permalink
Merge pull request #8530 from hamburnyog/add-more-int-type-aliases
Browse files Browse the repository at this point in the history
Add int type aliases based on existing codes
  • Loading branch information
orklah committed Oct 5, 2022
2 parents 313ebf4 + 0c3a62b commit 6051ae7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Psalm/Type/Atomic.php
Expand Up @@ -229,6 +229,15 @@ public static function create(

case 'positive-int':
return new TPositiveInt();

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

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

case 'non-negative-int':
return new TIntRange(0, null);

case 'numeric':
return $php_version !== null ? new TNamedObject($value) : new TNumeric();
Expand Down

0 comments on commit 6051ae7

Please sign in to comment.