public function getFactory(Specification $spec): Factory
    {
        if(!isset($this->factories[get_class($spec)])) {
            throw new \OutOfRangeException(sprintf(
                'Factory for Specification "%s" not registred',
                get_class($spec)
            ));
        }

        return $this->factories[get_class($spec)];
    }
public function getFactory(Specification $spec): Factory
    {
        if(!isset($this->factories[get_class($spec)])) {
            throw new \OutOfRangeException(sprintf(
                'Factory for Specification "%s" not registred',
                get_class($spec)
            ));
        }

        return $this->factories[get_class($spec)];
    }
public function getFactory ( Specification $ spec ) : Factory { if ( ! isset ( $ this -> factories [ get_class ( $ spec ) ] ) ) { throw new \ OutOfRangeException ( sprintf ( 'Factory for Specification "%s" not registred' , get_class ( $ spec ) ) ) ; } return $ this -> factories [ get_class ( $ spec ) ] ; }
Get registred factory for Specification

@param Specification $spec

@return Factory

@throw OutOfRangeException if Factory not found
Get registred factory for Specification