It is recommended to use static analysis, with it's definitions:
@implements Pipe<TMatchInput, TMatchOutput>
/** * @implements Pipe<ReflectionClass, ReflectionClass> */classInterfacesExtractorimplementsPipe{/** * @paramReflectionClass $input * @returnCollection<array-key, ReflectionClass> */publicfunction__invoke($input):Collection {// The returned collection can be empty (will remove the item),// or can have one or more items. All of the items will share// the same source file.returnnewCollection( $input->getInterfaces(), ); }}
Example of a "filter" pipe (keeps or removes an item, never adds or transforms)