public function supports(mixed $resource, ?string $type = null) : bool { return $resource instanceof \Closure && (!$type || 'closure' === $type); }