public function fetchByType($type)
    {
        if (! $this->hasType($type)) {
            throw new Exception\ResolverTypeNotFoundException();
        }

        $resolvers = new self();

        foreach ($this as $resolver) {
            if ($resolver instanceof $type) {
                $resolvers->attach($resolver);
            }
        }

        if (1 === count($resolvers)) {
            return $resolvers->queue->extract();
        }

        return $resolvers;
    }
public function fetchByType($type)
    {
        if (! $this->hasType($type)) {
            throw new Exception\ResolverTypeNotFoundException();
        }

        $resolvers = new self();

        foreach ($this as $resolver) {
            if ($resolver instanceof $type) {
                $resolvers->attach($resolver);
            }
        }

        if (1 === count($resolvers)) {
            return $resolvers->queue->extract();
        }

        return $resolvers;
    }
public function fetchByType ( $ type ) { if ( ! $ this -> hasType ( $ type ) ) { throw new Exception \ ResolverTypeNotFoundException ( ) ; } $ resolvers = new self ( ) ; foreach ( $ this as $ resolver ) { if ( $ resolver instanceof $ type ) { $ resolvers -> attach ( $ resolver ) ; } } if ( 1 === count ( $ resolvers ) ) { return $ resolvers -> queue -> extract ( ) ; } return $ resolvers ; }
Fetch one or more resolvers that match the given type.

@param string $type
@return ResolverInterface Return the matched instance, or an aggregate
containing all matched instances.
@throws Exception\ResolverTypeNotFoundException if no resolvers of the type are found.
Fetch one or more resolvers that match the given type .