,error_levels?:string[]}> */ public function providerValidCodeParse(): iterable { return [ 'example' => [ ' "Red", Suit::Clubs, Suit::Spades => "Black", }; } public function shape(): string { return "Rectangle"; } } function paint(Colourful $c): void {} function deal(Suit $s): void { if ($s === Suit::Clubs) { echo $s->color(); } } paint(Suit::Clubs); deal(Suit::Spades); Suit::Diamonds->shape();', [], [], '8.1' ], 'enumValue' => [ 'value === "h") {}', [], [], '8.1' ], 'enumCases' => [ ' "Red", Suit::Clubs, Suit::Spades => "Black", }; }', [], [], '8.1' ], ]; } /** * @return iterable */ public function providerInvalidCodeParse(): iterable { return [ 'enumValueIsNot' => [ 'value === "a") {}', 'error_message' => 'TypeDoesNotContainType', [], false, '8.1' ], 'enumValueNotBacked' => [ 'value;', 'error_message' => 'UndefinedPropertyFetch', [], false, '8.1' ], 'badSuit' => [ ' 'UndefinedConstant', [], false, '8.1' ], 'cantCompareToSuitTwice' => [ ' 'RedundantCondition', [], false, '8.1' ], 'insufficientMatches' => [ ' "Red", Suit::Clubs => "Black", }; } }', 'error_message' => 'UnhandledMatchCondition', [], false, '8.1' ], 'insufficientMatchesForCases' => [ ' "Red", Suit::Clubs => "Black", }; }', 'error_message' => 'UnhandledMatchCondition', [], false, '8.1' ], ]; } }