Skip to content

Commit 8246e6d

Browse files
Fix
1 parent 080836b commit 8246e6d

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

tests/PHPStan/Analyser/nsrt/bug-12393b.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ function doStrings($nonEmpty, $nonFalsy, $numeric, $literal, $lower, $upper) {
177177
$this->foo = $nonEmpty;
178178
assertType('int', $this->foo);
179179
$this->foo = $nonFalsy;
180-
assertType('int<min, -1>|int<1, max>', $this->foo);
180+
assertType('int', $this->foo);
181181
$this->foo = $numeric;
182182
assertType('int', $this->foo);
183183
$this->foo = $literal;
@@ -706,4 +706,3 @@ public function __toString(): string {
706706
return 'Foo';
707707
}
708708
}
709-

tests/PHPStan/Analyser/nsrt/non-falsy-string.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Foo {
1111
* @param truthy-string $truthyString
1212
*/
1313
public function bar($nonFalseyString, $truthyString) {
14-
assertType('int', (int) $nonFalseyString);
14+
assertType('int', (int) $nonFalseyString); // Do not remove `0` since `(int) '00'` is still `0`
1515
// truthy-string is an alias for non-falsy-string
1616
assertType('non-falsy-string', $truthyString);
1717
}

0 commit comments

Comments
 (0)