File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -872,21 +872,20 @@ public function specifyTypesInCondition(
872872 && count ($ expr ->expr ->getArgs ()) >= 2
873873 ) {
874874 $ funcName = $ expr ->expr ->name ->toLowerString ();
875- $ arrayArgIndex = null ;
875+ $ arrayArg = null ;
876876 $ sentinelType = null ;
877877 $ isStrictArraySearch = false ;
878878
879879 if ($ funcName === 'array_search ' ) {
880- $ arrayArgIndex = 1 ;
880+ $ arrayArg = $ expr -> expr -> getArgs ()[ 1 ]-> value ;
881881 $ sentinelType = new ConstantBooleanType (false );
882882 $ isStrictArraySearch = count ($ expr ->expr ->getArgs ()) >= 3 && $ scope ->getType ($ expr ->expr ->getArgs ()[2 ]->value )->isTrue ()->yes ();
883883 } elseif ($ funcName === 'array_find_key ' ) {
884- $ arrayArgIndex = 0 ;
884+ $ arrayArg = $ expr -> expr -> getArgs ()[ 0 ]-> value ;
885885 $ sentinelType = new NullType ();
886886 }
887887
888- if ($ arrayArgIndex !== null ) {
889- $ arrayArg = $ expr ->expr ->getArgs ()[$ arrayArgIndex ]->value ;
888+ if ($ arrayArg !== null ) {
890889 $ arrayType = $ scope ->getType ($ arrayArg );
891890
892891 if ($ arrayType ->isArray ()->yes ()) {
You can’t perform that action at this time.
0 commit comments