,error_levels?:string[]}> */ public function providerValidCodeParse() { return [ 'switchTruthy' => [ 'a !== null => $obj->a, $obj->b !== null => $obj->b, default => throw new \InvalidArgumentException("$obj->a or $obj->b must be set"), }; }', [], [], '8.0' ], 'defaultAboveCase' => [ ' "hello", default => "yellow", "b" => "goodbye", }; }', [], [], '8.0' ], 'allMatchedNoRedundantCondition' => [ ' "hello", "b" => "goodbye", }; }', [], [], '8.0' ], ]; } /** * @return iterable */ public function providerInvalidCodeParse() { return [ 'getClassArgWrongClass' => [ ' $a->barBar(), };', 'error_message' => 'UndefinedMethod', [], false, '8.0' ], 'getClassMissingClass' => [ ' 5, };', 'error_message' => 'UndefinedClass', [], false, '8.0' ], 'allMatchedDefaultImpossible' => [ ' "hello", "b" => "goodbye", default => "impossible", }; }', 'error_message' => 'TypeDoesNotContainType', [], false, '8.0' ], 'allMatchedAnotherImpossible' => [ ' "hello", "b" => "goodbye", "c" => "impossible", }; }', 'error_message' => 'TypeDoesNotContainType', [], false, '8.0' ], ]; } }