[ 'fooFoo(); } }', ], 'instanceOfIntOffset' => [ 'fooFoo(); } }', ], 'notEmptyStringOffset' => [ ' $a */ function bar (array $a) : string { if ($a["bat"]) { return $a["bat"]; } return "blah"; }', ], 'issetPropertyStringOffset' => [ ' */ public $arr = []; } $a = new A(); if (!isset($a->arr["bat"]) || strlen($a->arr["bat"])) { }', ], 'notEmptyIntOffset' => [ ' $a */ function bar (array $a) : string { if ($a[0]) { return $a[0]; } return "blah"; }', ], 'ignorePossiblyNullArrayAccess' => [ ' ['PossiblyNullArrayAccess'], ], 'ignorePossiblyNullArrayAccess' => [ ' [ '$x' => 'mixed', ], 'error_levels' => ['EmptyArrayAccess', 'MixedAssignment'], ], ]; } /** * @return array */ public function providerFileCheckerInvalidCodeParse() { return [ 'invalidArrayAccess' => [ ' 'InvalidArrayAccess', ], 'mixedArrayAccess' => [ ' 'MixedArrayAccess', 'error_level' => ['MixedAssignment'], ], 'mixedArrayOffset' => [ ' 'MixedArrayOffset', 'error_level' => ['MixedAssignment'], ], 'nullArrayAccess' => [ ' 'NullArrayAccess', ], 'possiblyNullArrayAccess' => [ ' 'PossiblyNullArrayAccess', ], ]; } }