Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
clxmstaab committed May 10, 2022
1 parent 2fa51e0 commit 6379aff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Analyser/MutatingScope.php
Expand Up @@ -62,7 +62,6 @@
use PHPStan\TrinaryLogic;
use PHPStan\Type\Accessory\AccessoryLiteralStringType;
use PHPStan\Type\Accessory\AccessoryNonEmptyStringType;
use PHPStan\Type\Accessory\AccessoryNumericStringType;
use PHPStan\Type\Accessory\NonEmptyArrayType;
use PHPStan\Type\ArrayType;
use PHPStan\Type\BenevolentUnionType;
Expand Down Expand Up @@ -695,6 +694,8 @@ private function resolveType(Expr $node): Type
if ($type->isNonEmptyString()->yes()) {
$accessories[] = new AccessoryNonEmptyStringType();
}
// it is not useful to apply numeric and literal strings here.
// numeric string isn't certainly kept numeric: 3v4l.org/JERDB

return TypeCombinator::intersect(...$accessories);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/PHPStan/Analyser/data/bitwise-not.php
Expand Up @@ -8,7 +8,7 @@
* @param string|int $stringOrInt
* @param non-empty-string $nonEmptyString
*/
function foo(int $int, string $string, float $float, $stringOrInt, $numericString, $literalString, string $nonEmptyString) : void{
function foo(int $int, string $string, float $float, $stringOrInt, string $nonEmptyString) : void{
assertType('int', ~$int);
assertType('string', ~$string);
assertType('non-empty-string', ~$nonEmptyString);
Expand Down

0 comments on commit 6379aff

Please sign in to comment.