Making Pipes
use Juampi92\Phecks\Domain\Contracts\Pipe;/**
* @param TMatchInput $input
* @return Collection<array-key, TMatchOutput>
*/
public function __invoke($input): Collection
{/**
* @implements Pipe<ReflectionClass, ReflectionClass>
*/
class InterfacesExtractor implements Pipe
{
/**
* @param ReflectionClass $input
* @return Collection<array-key, ReflectionClass>
*/
public function __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.
return new Collection(
$input->getInterfaces(),
);
}
}Last updated