[ ' [ '$a' => 'mixed', ], 'error_levels' => ['MixedAssignment'], ], 'emptyArrayVar' => [ ' [], 'error_levels' => ['MixedAssignment', 'MixedArrayAccess'], ], 'removeEmptyArray' => [ ' [ ' [ ' [ 'getMessage() === "hello") { return "hello"; } elseif (empty($a)) { return "goodbye"; } return $a->getMessage(); }', ], 'noFalsyLeak' => [ ' [ ' [], 'error_levels' => ['MixedAssignment', 'MixedArrayAccess'], ], 'dontBleedEmptyAfterExtract' => [ ' [], 'error_levels' => ['MixedAssignment', 'MixedArgument'], ], 'emptyObjectLike' => [ ' [ "foo" => "bar", ], "groups" => [ "foo" => "bar", "hide" => rand(0, 5), ], ]; foreach ($arr as $item) { if (empty($item["hide"]) || $item["hide"] === 3) {} }', ], 'alwaysBoolResult' => [ ' [ ' [ ' [], 'error_levels' => ['MixedAssignment', 'MissingParamType'], ], 'noReconciliationForMixed' => [ ' [], 'error_levels' => ['MixedAssignment', 'MissingParamType'], ], ]; } /** * @return array */ public function providerFileCheckerInvalidCodeParse() { return [ 'preventImpossibleEmpty' => [ ' 'UndefinedVariable', ], ]; } }