We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5d8709e commit 89641e5Copy full SHA for 89641e5
src/Rules/Functions/PrintfPlaceholder.php
@@ -2,6 +2,7 @@
2
3
namespace PHPStan\Rules\Functions;
4
5
+use PHPStan\ShouldNotHappenException;
6
use PHPStan\Type\ErrorType;
7
use PHPStan\Type\IntegerType;
8
use PHPStan\Type\Type;
@@ -33,6 +34,10 @@ public function doesArgumentTypeMatchPlaceholder(Type $argumentType): bool
33
34
case 'string':
35
case 'mixed':
36
return true;
37
+ // Without this PHPStan with PHP 7.4 reports "...should return bool but return statement is missing."
38
+ // Presumably, because promoted properties are turned into regular properties and the phpdoc isn't applied to the property.
39
+ default:
40
+ throw new ShouldNotHappenException('Unexpected type ' . $this->acceptingType);
41
}
42
43
0 commit comments