[ 'code' => '[] */ function getValues($array) { return array_values($array); } ', ], 'SKIPPED-acceptsIfInArrayFn' => [ 'code' => '|null */ function getValue(string $value, $array) { if (in_array($value, $array)) { return $value; } return null; } ', ], 'valueOfUnreplacedTemplateParam' => [ 'code' => ' */ abstract class Foo { /** * @return value-of */ abstract public function getRandomValue(): bool; } ', ], 'valueOfNestedTemplates' => [ 'code' => ' * @param TArray $array * @return list */ function toList(array $array): array { return array_values($array); }', ], ]; } public function providerInvalidCodeParse(): iterable { return [ 'valueOfTemplateNotIncludesString' => [ 'code' => ' */ function getValue($array) { return "foo"; } ', 'error_message' => 'InvalidReturnStatement', ], 'valueOfTemplateNotIncludesInt' => [ 'code' => ' */ function getValue($array) { return 0; } ', 'error_message' => 'InvalidReturnStatement', ], 'valueOfUnresolvedTemplateParamIsStillChecked' => [ 'code' => ' */ abstract class Foo { /** * @return value-of */ abstract public function getRandomValue(): string; } ', 'error_message' => 'MismatchingDocblockReturnType', ], ]; } }