22
33namespace PHPStan \Type \Php ;
44
5- <<<<<<< HEAD
6- <<<<<<< HEAD
7- <<<<<<< HEAD
8- =======
9- use PhpParser \Node \Arg ;
10- =======
11- =======
125use PhpParser \ConstExprEvaluationException ;
13- >>>>>>> decopule type resolution to static
146use PhpParser \ConstExprEvaluator ;
15- >>>>>>> check for JSON_OBJECT_AS_ARRAY , in case of null and array
167use PhpParser \Node \Expr ;
17- use PhpParser \Node \Expr \BinaryOp \BitwiseOr ;
188use PhpParser \Node \Expr \ConstFetch ;
19- >>>>>>> Extend JsonThrowOnErrorDynamicReturnTypeExtension to detect knonw type from contssant string value
209use PhpParser \Node \Expr \FuncCall ;
2110use PhpParser \Node \Name \FullyQualified ;
2211use PHPStan \Analyser \Scope ;
2312use PHPStan \Reflection \FunctionReflection ;
2413use PHPStan \Reflection \ParametersAcceptorSelector ;
2514use PHPStan \Reflection \ReflectionProvider ;
26- <<<<<<< HEAD
27- <<<<<<< HEAD
2815use PHPStan \Type \BitwiseFlagHelper ;
2916use PHPStan \Type \Constant \ConstantBooleanType ;
30- =======
31- use PHPStan \Type \ArrayType ;
32- use PHPStan \Type \BooleanType ;
33- =======
34- >>>>>>> return mixed type
35- use PHPStan \Type \Constant \ConstantBooleanType ;
3617use PHPStan \Type \Constant \ConstantIntegerType ;
3718use PHPStan \Type \Constant \ConstantStringType ;
3819use PHPStan \Type \ConstantTypeHelper ;
39- >>>>>>> Extend JsonThrowOnErrorDynamicReturnTypeExtension to detect knonw type from contssant string value
4020use PHPStan \Type \DynamicFunctionReturnTypeExtension ;
4121use PHPStan \Type \MixedType ;
4222use PHPStan \Type \ObjectType ;
@@ -53,22 +33,18 @@ class JsonThrowOnErrorDynamicReturnTypeExtension implements DynamicFunctionRetur
5333
5434 private const UNABLE_TO_RESOLVE = '__UNABLE_TO_RESOLVE__ ' ;
5535
36+ private ConstExprEvaluator $ constExprEvaluator ;
37+
5638 /** @var array<string, int> */
5739 private array $ argumentPositions = [
5840 'json_encode ' => 1 ,
5941 'json_decode ' => 3 ,
6042 ];
6143
62- <<<<<<< HEAD
6344 public function __construct (
6445 private ReflectionProvider $ reflectionProvider ,
6546 private BitwiseFlagHelper $ bitwiseFlagAnalyser ,
6647 )
67- =======
68- private ConstExprEvaluator $ constExprEvaluator ;
69-
70- public function __construct(private ReflectionProvider $ reflectionProvider )
71- >>>>>>> decopule type resolution to static
7248 {
7349 $ this ->constExprEvaluator = new ConstExprEvaluator (static function (Expr $ expr ) {
7450 if ($ expr instanceof ConstFetch) {
0 commit comments