src/Rocketeer/Services/Builders/Modules/StrategiesBuilder.php
public function buildStrategy($strategy, $concrete = null)
    {
        // If we passed a concrete implementation
        // look for it specifically
        $handle = Str::snake($strategy, '-');
        if ($concrete) {
            $handle .= '.'.Str::snake($concrete, '-');
        }

        // If no found instance, create a new one
        $handle = 'rocketeer.strategies.'.$handle;
        if (!$this->container->has($handle)) {
            $option = Str::snake($strategy, '-');
            $concrete = $concrete ?: $this->config->getContextually('strategies.'.$option);
            $strategy = $this->buildStrategyFromName($strategy, $concrete);
            if (!$strategy) {
                return;
            }

            $this->container->add($handle, $strategy);
        }

        // Get and register modules
        /** @var AbstractStrategy $strategy */
        $strategy = $this->container->get($handle);
        $strategy = $this->modulable->registerBashModulesOn($strategy);

        return $strategy;
    }
public function buildStrategy($strategy, $concrete = null)
    {
        // If we passed a concrete implementation
        // look for it specifically
        $handle = Str::snake($strategy, '-');
        if ($concrete) {
            $handle .= '.'.Str::snake($concrete, '-');
        }

        // If no found instance, create a new one
        $handle = 'rocketeer.strategies.'.$handle;
        if (!$this->container->has($handle)) {
            $option = Str::snake($strategy, '-');
            $concrete = $concrete ?: $this->config->getContextually('strategies.'.$option);
            $strategy = $this->buildStrategyFromName($strategy, $concrete);
            if (!$strategy) {
                return;
            }

            $this->container->add($handle, $strategy);
        }

        // Get and register modules
        /** @var AbstractStrategy $strategy */
        $strategy = $this->container->get($handle);
        $strategy = $this->modulable->registerBashModulesOn($strategy);

        return $strategy;
    }
public function buildStrategy ( $ strategy , $ concrete = null ) { // If we passed a concrete implementation // look for it specifically $ handle = Str :: snake ( $ strategy , '-' ) ; if ( $ concrete ) { $ handle .= '.' . Str :: snake ( $ concrete , '-' ) ; } // If no found instance, create a new one $ handle = 'rocketeer.strategies.' . $ handle ; if ( ! $ this -> container -> has ( $ handle ) ) { $ option = Str :: snake ( $ strategy , '-' ) ; $ concrete = $ concrete ? : $ this -> config -> getContextually ( 'strategies.' . $ option ) ; $ strategy = $ this -> buildStrategyFromName ( $ strategy , $ concrete ) ; if ( ! $ strategy ) { return ; } $ this -> container -> add ( $ handle , $ strategy ) ; } // Get and register modules /** @var AbstractStrategy $strategy */ $ strategy = $ this -> container -> get ( $ handle ) ; $ strategy = $ this -> modulable -> registerBashModulesOn ( $ strategy ) ; return $ strategy ; }
Build a strategy.

@param string      $strategy
@param string|null $concrete

@return \Rocketeer\Strategies\AbstractStrategy|\Rocketeer\Strategies\Framework\FrameworkStrategyInterface|false
Build a strategy .