Skip to content
Permalink
Browse files

Fix subtraction of string from numeric

  • Loading branch information
muglug committed Jan 10, 2020
1 parent df8e384 commit 5ddcab1003e1eef5adb41689bb03d564d6d04612
@@ -1004,6 +1004,9 @@ private static function reconcileString(
]);
$non_string_types[] = new Atomic\TCallableObject();
$did_remove_type = true;
} elseif ($type instanceof TNumeric) {
$non_string_types[] = $type;
$did_remove_type = true;
} elseif (!$type instanceof TString) {
$non_string_types[] = $type;
} else {
@@ -746,6 +746,16 @@ function propertyInUse(array $tokens, int $i): bool {
return false;
}'
],
'numericNotString' => [
'<?php
/** @param mixed $value */
function test($value) : void {
if (!is_numeric($value)) {
throw new Exception("Invalid $value");
}
if (!is_string($value)) {}
}'
],
];
}

0 comments on commit 5ddcab1

Please sign in to comment.
You can’t perform that action at this time.