,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { return [ 'ifNotUndefinedAndEmpty' => [ 'code' => ' [ '$a' => 'mixed|null', ], 'ignored_issues' => ['MixedAssignment'], ], 'emptyArrayVar' => [ 'code' => ' [], 'ignored_issues' => ['MixedAssignment', 'MixedArrayAccess'], ], 'removeEmptyArray' => [ 'code' => ' [ 'code' => ' [ 'code' => ' [ 'code' => 'getMessage() === "hello") { return "hello"; } elseif (empty($a)) { return "goodbye"; } return $a->getMessage(); }', ], 'noFalsyLeak' => [ 'code' => ' [ 'code' => ' [], 'ignored_issues' => ['MixedAssignment', 'MixedArrayAccess'], ], 'dontBleedEmptyAfterExtract' => [ 'code' => ' [], 'ignored_issues' => ['MixedAssignment', 'MixedArgument'], ], 'emptyTKeyedArray' => [ 'code' => ' [ "foo" => "bar", ], "groups" => [ "foo" => "bar", "hide" => rand(0, 5), ], ]; foreach ($arr as $item) { if (empty($item["hide"]) || $item["hide"] === 3) {} }', ], 'alwaysBoolResult' => [ 'code' => ' [ 'code' => ' [ 'code' => ' [], 'ignored_issues' => ['MixedAssignment', 'MissingParamType'], ], 'canBeNonEmptyArray' => [ 'code' => ' [], 'ignored_issues' => ['MixedAssignment', 'MissingParamType', 'MixedArgument'], ], 'multipleEmptiesInCondition' => [ 'code' => ' $o */ function foo(array $o) : void { if (empty($o[0]) && empty($o[1])) {} }', ], 'multipleEmptiesInConditionWithMixedOffset' => [ 'code' => ' [ 'code' => ' [ 'code' => ' [], 'ignored_issues' => ['MixedAssignment', 'MissingParamType', 'MixedArgument', 'MixedArrayOffset', 'MixedArrayAccess'], ], 'possiblyEmptyIterable' => [ 'code' => ' [ 'code' => ' $data */ function bat(array $data) : void { if (!empty($data["foo"])) { if (empty($data[Foo::BAR])) {} } } /** * @param array $data */ function baz(array $data) : void { if (!empty($data[0])) { if (empty($data[Foo::ONE])) {} } }', ], 'doubleEmptyCheckTwoArrays' => [ 'code' => ' [ 'code' => ' [ 'code' => ' [ 'code' => ' [ 'code' => 'b)) {} }', ], 'allowNumericEmpty' => [ 'code' => ' [ 'code' => ' [ 'code' => ' [ 'code' => ' [ 'code' => ',php_version?:string}> */ public function providerInvalidCodeParse(): iterable { return [ 'preventImpossibleEmpty' => [ 'code' => ' 'UndefinedVariable', ], 'reconciliationForMixed' => [ 'code' => ' 'RedundantCondition', 'ignored_issues' => ['MixedAssignment', 'MissingParamType'], ], 'preventEmptyOnBool' => [ 'code' => ' 'InvalidArgument', ], 'preventEmptyCreatingArray' => [ 'code' => ' 'MixedReturnTypeCoercion' ], 'preventEmptyEquivalentCreatingArray' => [ 'code' => ' 'MixedReturnTypeCoercion' ], 'secondEmptyTwice' => [ 'code' => ' 'RedundantCondition' ], ]; } }