From 9524d23cb10549a4daaa4442373756db0b128245 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 10 May 2022 09:47:56 +0200 Subject: [PATCH] it's useful to apply numeric and literal strings this way --- src/Analyser/MutatingScope.php | 6 ------ tests/PHPStan/Analyser/data/bitwise-not.php | 4 ---- 2 files changed, 10 deletions(-) diff --git a/src/Analyser/MutatingScope.php b/src/Analyser/MutatingScope.php index 829921f3d0f..e5d5ea67cf8 100644 --- a/src/Analyser/MutatingScope.php +++ b/src/Analyser/MutatingScope.php @@ -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); } diff --git a/tests/PHPStan/Analyser/data/bitwise-not.php b/tests/PHPStan/Analyser/data/bitwise-not.php index 5f4de7f6546..a9e406d489a 100644 --- a/tests/PHPStan/Analyser/data/bitwise-not.php +++ b/tests/PHPStan/Analyser/data/bitwise-not.php @@ -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);