Skip to content

Commit

Permalink
it's useful to apply numeric and literal strings this way
Browse files Browse the repository at this point in the history
  • Loading branch information
clxmstaab committed May 10, 2022
1 parent b288633 commit 9524d23
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
6 changes: 0 additions & 6 deletions src/Analyser/MutatingScope.php
Expand Up @@ -696,12 +696,6 @@ private function resolveType(Expr $node): Type
if ($type->isNonEmptyString()->yes()) {
$accessories[] = new AccessoryNonEmptyStringType();
}
if ($type->isLiteralString()->yes()) {
$accessories[] = new AccessoryLiteralStringType();
}
if ($type->isNumericString()->yes()) {
$accessories[] = new AccessoryNumericStringType();
}

return TypeCombinator::intersect(...$accessories);
}
Expand Down
4 changes: 0 additions & 4 deletions tests/PHPStan/Analyser/data/bitwise-not.php
Expand Up @@ -6,15 +6,11 @@

/**
* @param string|int $stringOrInt
* @param numeric-string $numericString
* @param literal-string $literalString
* @param non-empty-string $nonEmptyString
*/
function foo(int $int, string $string, float $float, $stringOrInt, $numericString, $literalString, string $nonEmptyString) : void{
assertType('int', ~$int);
assertType('string', ~$string);
assertType('non-empty-string&numeric-string', ~$numericString);
assertType('literal-string', ~$literalString);
assertType('non-empty-string', ~$nonEmptyString);
assertType('int', ~$float);
assertType('int|string', ~$stringOrInt);
Expand Down

0 comments on commit 9524d23

Please sign in to comment.