src/main/php/ioc/Injector.php
private function findImplementation(Annotations $annotations, $type)
    {
        $implementation = null;
        foreach ($annotations->named('ImplementedBy') as $annotation) {
            /* @var $annotation \stubbles\reflect\annotation\Annotation */
            if (null !== $this->environment && $annotation->hasValueByName('mode') && strtoupper($annotation->getMode()) === $this->environment) {
                $implementation = $annotation->getClass();
            } elseif (!$annotation->hasValueByName('mode') && null == $implementation) {
                $implementation = $annotation->getClass();
            }
        }

        if (null === $implementation) {
            throw new BindingException('Interface ' . $type . ' annotated with @ImplementedBy, but no default found');
        }

        return $implementation;
    }
private function findImplementation(Annotations $annotations, $type)
    {
        $implementation = null;
        foreach ($annotations->named('ImplementedBy') as $annotation) {
            /* @var $annotation \stubbles\reflect\annotation\Annotation */
            if (null !== $this->environment && $annotation->hasValueByName('mode') && strtoupper($annotation->getMode()) === $this->environment) {
                $implementation = $annotation->getClass();
            } elseif (!$annotation->hasValueByName('mode') && null == $implementation) {
                $implementation = $annotation->getClass();
            }
        }

        if (null === $implementation) {
            throw new BindingException('Interface ' . $type . ' annotated with @ImplementedBy, but no default found');
        }

        return $implementation;
    }
finds implementation to be used from list of @ImplementedBy annotations

@param   \stubbles\reflect\annotation\Annotations  $annotations
@param   string                                         $type
@return  \ReflectionClass
@throws  \stubbles\ioc\binding\BindingException