Skip to content

Commit

Permalink
Support string accessory types in BitwiseNot
Browse files Browse the repository at this point in the history
  • Loading branch information
clxmstaab committed Apr 28, 2022
1 parent 6ebf236 commit f2be74b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/PHPStan/Analyser/data/bitwise-not.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@

/**
* @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) : void{
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);
assertType("'" . (~"abc") . "'", ~"abc");
Expand Down

0 comments on commit f2be74b

Please sign in to comment.