@@ -1936,7 +1936,7 @@ function (MutatingScope $scope) use ($expr, $nodeCallback, $context): Expression
1936
1936
$ hasYield = $ result ->hasYield ();
1937
1937
$ throwPoints = array_merge ($ throwPoints , $ result ->getThrowPoints ());
1938
1938
1939
- if (isset ( $ functionReflection) ) {
1939
+ if ($ functionReflection !== null ) {
1940
1940
$ functionThrowPoint = $ this ->getFunctionThrowPoint ($ functionReflection , $ parametersAcceptor , $ expr , $ scope );
1941
1941
if ($ functionThrowPoint !== null ) {
1942
1942
$ throwPoints [] = $ functionThrowPoint ;
@@ -1946,7 +1946,7 @@ function (MutatingScope $scope) use ($expr, $nodeCallback, $context): Expression
1946
1946
}
1947
1947
1948
1948
if (
1949
- isset ( $ functionReflection)
1949
+ $ functionReflection !== null
1950
1950
&& in_array ($ functionReflection ->getName (), ['json_encode ' , 'json_decode ' ], true )
1951
1951
) {
1952
1952
$ scope = $ scope ->invalidateExpression (new FuncCall (new Name ('json_last_error ' ), []))
@@ -1956,7 +1956,7 @@ function (MutatingScope $scope) use ($expr, $nodeCallback, $context): Expression
1956
1956
}
1957
1957
1958
1958
if (
1959
- isset ( $ functionReflection)
1959
+ $ functionReflection !== null
1960
1960
&& in_array ($ functionReflection ->getName (), ['array_pop ' , 'array_shift ' ], true )
1961
1961
&& count ($ expr ->getArgs ()) >= 1
1962
1962
) {
@@ -1974,7 +1974,7 @@ function (MutatingScope $scope) use ($expr, $nodeCallback, $context): Expression
1974
1974
}
1975
1975
1976
1976
if (
1977
- isset ( $ functionReflection)
1977
+ $ functionReflection !== null
1978
1978
&& in_array ($ functionReflection ->getName (), ['array_push ' , 'array_unshift ' ], true )
1979
1979
&& count ($ expr ->getArgs ()) >= 2
1980
1980
) {
@@ -1986,13 +1986,16 @@ function (MutatingScope $scope) use ($expr, $nodeCallback, $context): Expression
1986
1986
}
1987
1987
1988
1988
if (
1989
- isset ( $ functionReflection)
1989
+ $ functionReflection !== null
1990
1990
&& in_array ($ functionReflection ->getName (), ['fopen ' , 'file_get_contents ' ], true )
1991
1991
) {
1992
1992
$ scope = $ scope ->assignVariable ('http_response_header ' , new ArrayType (new IntegerType (), new StringType ()), new ArrayType (new IntegerType (), new StringType ()));
1993
1993
}
1994
1994
1995
- if (isset ($ functionReflection ) && $ functionReflection ->getName () === 'shuffle ' ) {
1995
+ if (
1996
+ $ functionReflection !== null
1997
+ && $ functionReflection ->getName () === 'shuffle '
1998
+ ) {
1996
1999
$ arrayArg = $ expr ->getArgs ()[0 ]->value ;
1997
2000
$ scope = $ scope ->assignExpression (
1998
2001
$ arrayArg ,
@@ -2002,7 +2005,7 @@ function (MutatingScope $scope) use ($expr, $nodeCallback, $context): Expression
2002
2005
}
2003
2006
2004
2007
if (
2005
- isset ( $ functionReflection)
2008
+ $ functionReflection !== null
2006
2009
&& $ functionReflection ->getName () === 'array_splice '
2007
2010
&& count ($ expr ->getArgs ()) >= 1
2008
2011
) {
@@ -2020,7 +2023,10 @@ function (MutatingScope $scope) use ($expr, $nodeCallback, $context): Expression
2020
2023
);
2021
2024
}
2022
2025
2023
- if (isset ($ functionReflection ) && $ functionReflection ->getName () === 'extract ' ) {
2026
+ if (
2027
+ $ functionReflection !== null
2028
+ && $ functionReflection ->getName () === 'extract '
2029
+ ) {
2024
2030
$ extractedArg = $ expr ->getArgs ()[0 ]->value ;
2025
2031
$ extractedType = $ scope ->getType ($ extractedArg );
2026
2032
if (count ($ extractedType ->getConstantArrays ()) > 0 ) {
@@ -2057,15 +2063,24 @@ function (MutatingScope $scope) use ($expr, $nodeCallback, $context): Expression
2057
2063
}
2058
2064
}
2059
2065
2060
- if (isset ($ functionReflection ) && ($ functionReflection ->getName () === 'clearstatcache ' || $ functionReflection ->getName () === 'unlink ' )) {
2066
+ if (
2067
+ $ functionReflection !== null
2068
+ && ($ functionReflection ->getName () === 'clearstatcache ' || $ functionReflection ->getName () === 'unlink ' )
2069
+ ) {
2061
2070
$ scope = $ scope ->afterClearstatcacheCall ();
2062
2071
}
2063
2072
2064
- if (isset ($ functionReflection ) && str_starts_with ($ functionReflection ->getName (), 'openssl ' )) {
2073
+ if (
2074
+ $ functionReflection !== null
2075
+ && str_starts_with ($ functionReflection ->getName (), 'openssl ' )
2076
+ ) {
2065
2077
$ scope = $ scope ->afterOpenSslCall ($ functionReflection ->getName ());
2066
2078
}
2067
2079
2068
- if (isset ($ functionReflection ) && $ functionReflection ->hasSideEffects ()->yes ()) {
2080
+ if (
2081
+ $ functionReflection !== null
2082
+ && $ functionReflection ->hasSideEffects ()->yes ()
2083
+ ) {
2069
2084
foreach ($ expr ->getArgs () as $ arg ) {
2070
2085
$ scope = $ scope ->invalidateExpression ($ arg ->value , true );
2071
2086
}
0 commit comments