library/Odesk/Phystrix/CommandFactory.php
public function getCommand($class)
    {
        $parameters = func_get_args();
        array_shift($parameters);

        $reflection = new ReflectionClass($class);
        /** @var AbstractCommand $command */
        $command = empty($parameters) ?
            $reflection->newInstance() :
            $reflection->newInstanceArgs($parameters);

        $command->setCircuitBreakerFactory($this->circuitBreakerFactory);
        $command->setCommandMetricsFactory($this->commandMetricsFactory);
        $command->setServiceLocator($this->serviceLocator);
        $command->initializeConfig($this->config);

        if ($this->requestCache) {
            $command->setRequestCache($this->requestCache);
        }

        if ($this->requestLog) {
            $command->setRequestLog($this->requestLog);
        }

        return $command;
    }
public function getCommand($class)
    {
        $parameters = func_get_args();
        array_shift($parameters);

        $reflection = new ReflectionClass($class);
        /** @var AbstractCommand $command */
        $command = empty($parameters) ?
            $reflection->newInstance() :
            $reflection->newInstanceArgs($parameters);

        $command->setCircuitBreakerFactory($this->circuitBreakerFactory);
        $command->setCommandMetricsFactory($this->commandMetricsFactory);
        $command->setServiceLocator($this->serviceLocator);
        $command->initializeConfig($this->config);

        if ($this->requestCache) {
            $command->setRequestCache($this->requestCache);
        }

        if ($this->requestLog) {
            $command->setRequestLog($this->requestLog);
        }

        return $command;
    }
public function getCommand ( $ class ) { $ parameters = func_get_args ( ) ; array_shift ( $ parameters ) ; $ reflection = new ReflectionClass ( $ class ) ; /** @var AbstractCommand $command */ $ command = empty ( $ parameters ) ? $ reflection -> newInstance ( ) : $ reflection -> newInstanceArgs ( $ parameters ) ; $ command -> setCircuitBreakerFactory ( $ this -> circuitBreakerFactory ) ; $ command -> setCommandMetricsFactory ( $ this -> commandMetricsFactory ) ; $ command -> setServiceLocator ( $ this -> serviceLocator ) ; $ command -> initializeConfig ( $ this -> config ) ; if ( $ this -> requestCache ) { $ command -> setRequestCache ( $ this -> requestCache ) ; } if ( $ this -> requestLog ) { $ command -> setRequestLog ( $ this -> requestLog ) ; } return $ command ; }
Instantiates and configures a command

@param string $class
@return AbstractCommand
Instantiates and configures a command