Skip to content

Commit

Permalink
added truthy-string alias for non-falsy-string
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Aug 11, 2022
1 parent b6472ac commit 080d9ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Psalm/Type/Atomic.php
Expand Up @@ -211,6 +211,7 @@ public static function create(
case 'non-empty-string':
return new TNonEmptyString();

case 'truthy-string':
case 'non-falsy-string':
return new TNonFalsyString();

Expand Down
7 changes: 7 additions & 0 deletions tests/TypeCombinationTest.php
Expand Up @@ -717,6 +717,13 @@ public function providerTestValidTypeCombination(): array
'non-empty-string'
]
],
'combineTruthyStringAndNonEmptyString' => [
'non-empty-string',
[
'truthy-string',
'non-empty-string'
]
],
'combineNonFalsyNonEmptyString' => [
'non-empty-string',
[
Expand Down

0 comments on commit 080d9ef

Please sign in to comment.