Skip to content

Commit 43eb542

Browse files
TomasVotrubaondrejmirtes
authored andcommitted
use bitwiseFlagAnalyser
1 parent 8748e9c commit 43eb542

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Type/Php/JsonThrowOnErrorDynamicReturnTypeExtension.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
use function constant;
2727
use function is_bool;
2828
use function json_decode;
29-
use const JSON_OBJECT_AS_ARRAY;
3029

3130
class JsonThrowOnErrorDynamicReturnTypeExtension implements DynamicFunctionReturnTypeExtension
3231
{
@@ -138,8 +137,7 @@ private function isForceArrayWithoutStdClass(FuncCall $funcCall, Scope $scope):
138137

139138
// @see https://www.php.net/manual/en/json.constants.php#constant.json-object-as-array
140139
$thirdArgValue = $args[3]->value;
141-
$resolvedThirdArgValue = $this->resolveMaskValue($thirdArgValue, $scope);
142-
if (($resolvedThirdArgValue & JSON_OBJECT_AS_ARRAY) !== 0) {
140+
if ($this->bitwiseFlagAnalyser->bitwiseOrContainsConstant($thirdArgValue, $scope, 'JSON_OBJECT_AS_ARRAY')->yes()) {
143141
return true;
144142
}
145143
}

0 commit comments

Comments
 (0)