2
2
3
3
namespace PHPStan \Type \Php ;
4
4
5
- <<<<<<< HEAD
6
- <<<<<<< HEAD
7
- <<<<<<< HEAD
8
- =======
9
- use PhpParser \Node \Arg ;
10
- =======
11
- =======
12
5
use PhpParser \ConstExprEvaluationException ;
13
- >>>>>>> decopule type resolution to static
14
6
use PhpParser \ConstExprEvaluator ;
15
- >>>>>>> check for JSON_OBJECT_AS_ARRAY , in case of null and array
16
7
use PhpParser \Node \Expr ;
17
- use PhpParser \Node \Expr \BinaryOp \BitwiseOr ;
18
8
use PhpParser \Node \Expr \ConstFetch ;
19
- >>>>>>> Extend JsonThrowOnErrorDynamicReturnTypeExtension to detect knonw type from contssant string value
20
9
use PhpParser \Node \Expr \FuncCall ;
21
10
use PhpParser \Node \Name \FullyQualified ;
22
11
use PHPStan \Analyser \Scope ;
23
12
use PHPStan \Reflection \FunctionReflection ;
24
13
use PHPStan \Reflection \ParametersAcceptorSelector ;
25
14
use PHPStan \Reflection \ReflectionProvider ;
26
- <<<<<<< HEAD
27
- <<<<<<< HEAD
28
15
use PHPStan \Type \BitwiseFlagHelper ;
29
16
use 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 ;
36
17
use PHPStan \Type \Constant \ConstantIntegerType ;
37
18
use PHPStan \Type \Constant \ConstantStringType ;
38
19
use PHPStan \Type \ConstantTypeHelper ;
39
- >>>>>>> Extend JsonThrowOnErrorDynamicReturnTypeExtension to detect knonw type from contssant string value
40
20
use PHPStan \Type \DynamicFunctionReturnTypeExtension ;
41
21
use PHPStan \Type \MixedType ;
42
22
use PHPStan \Type \ObjectType ;
@@ -53,22 +33,18 @@ class JsonThrowOnErrorDynamicReturnTypeExtension implements DynamicFunctionRetur
53
33
54
34
private const UNABLE_TO_RESOLVE = '__UNABLE_TO_RESOLVE__ ' ;
55
35
36
+ private ConstExprEvaluator $ constExprEvaluator ;
37
+
56
38
/** @var array<string, int> */
57
39
private array $ argumentPositions = [
58
40
'json_encode ' => 1 ,
59
41
'json_decode ' => 3 ,
60
42
];
61
43
62
- <<<<<<< HEAD
63
44
public function __construct (
64
45
private ReflectionProvider $ reflectionProvider ,
65
46
private BitwiseFlagHelper $ bitwiseFlagAnalyser ,
66
47
)
67
- =======
68
- private ConstExprEvaluator $ constExprEvaluator ;
69
-
70
- public function __construct(private ReflectionProvider $ reflectionProvider )
71
- >>>>>>> decopule type resolution to static
72
48
{
73
49
$ this ->constExprEvaluator = new ConstExprEvaluator (static function (Expr $ expr ) {
74
50
if ($ expr instanceof ConstFetch) {
0 commit comments