[ ' [ ' [ ' [ ' [ ' [ ' [ ' [ ' [ ' [ ' [ ' [ ' [ ' [ ' [ ' [ ' [ ' [ ' [ ' [ ' 0; if (!$condition) { foreach ([1, 2] as $value) { if ($condition) { } $condition = true; } } }', ], 'noParadoxInListAssignment' => [ ' [ ' 0; } function leftover() : bool { $res = get_bool(); if ($res === false) { return true; } $res = get_bool(); if ($res === false) { return false; } return true; }' ], 'noParadoxAfterArrayAppending' => [ ' 0) { $errors[] = "unlucky"; } if ($errors) { return false; } return $errors; }' ], 'noParadoxInCatch' => [ ' 0) { return ["key" => "value"]; } if (rand() % 3 > 0) { throw new Exception("An exception occurred"); } return null; } function try_catch_check() : array { $arr = null; try { $arr = maybe_returns_array(); if (!$arr) { return []; } } catch (Exception $e) { if (!$arr) { return []; } } return $arr; }' ] ]; } /** * @return array */ public function providerFileCheckerInvalidCodeParse() { return [ 'threeVarLogicWithChange' => [ ' 'NullArgument', ], 'threeVarLogicWithException' => [ ' 'NullArgument', ], 'invertedTwoVarLogicNotNestedWithVarChange' => [ ' 'InvalidReturnType', ], 'invertedTwoVarLogicNotNestedWithElseif' => [ ' 'InvalidReturnType', ], 'threeVarLogicWithElseifAndAnd' => [ ' 'InvalidReturnType', ], 'twoVarLogicNotNestedWithElseifNegatedInIf' => [ ' 'InvalidReturnType', ], 'twoVarLogicNotNestedWithElseifIncorrectlyReinforcedInIf' => [ ' 'InvalidReturnType', ], 'repeatedIfStatements' => [ ' 'ParadoxicalCondition', ], 'repeatedConditionals' => [ ' 'ParadoxicalCondition', ], 'repeatedAndConditional' => [ ' 'ParadoxicalCondition', ], 'andConditionalAfterOrConditional' => [ ' 'ParadoxicalCondition', ], 'repeatedVarFromOrConditional' => [ ' 'ParadoxicalCondition', ], ]; } }