protected function _resolveStrategy($strategy)
    {
        $key = Security::salt();

        if (!$strategy) {
            $class = self::DEFAULT_STRATEGY;
            $strategy = new $class($key);
        }

        if (is_string($strategy) && class_exists($strategy)) {
            $strategy = new $strategy($key);
        }

        if (!($strategy instanceof StrategyInterface)) {
            throw new Exception('Invalid "strategy" configuration.');
        }

        return $strategy;
    }
protected function _resolveStrategy($strategy)
    {
        $key = Security::salt();

        if (!$strategy) {
            $class = self::DEFAULT_STRATEGY;
            $strategy = new $class($key);
        }

        if (is_string($strategy) && class_exists($strategy)) {
            $strategy = new $strategy($key);
        }

        if (!($strategy instanceof StrategyInterface)) {
            throw new Exception('Invalid "strategy" configuration.');
        }

        return $strategy;
    }
protected function _resolveStrategy ( $ strategy ) { $ key = Security :: salt ( ) ; if ( ! $ strategy ) { $ class = self :: DEFAULT_STRATEGY ; $ strategy = new $ class ( $ key ) ; } if ( is_string ( $ strategy ) && class_exists ( $ strategy ) ) { $ strategy = new $ strategy ( $ key ) ; } if ( ! ( $ strategy instanceof StrategyInterface ) ) { throw new Exception ( 'Invalid "strategy" configuration.' ) ; } return $ strategy ; }
Resolves configured strategy.

@param string|\Muffin\Crypt\Model\Behavior\Strategy\StrategyInterface $strategy Strategy
@return mixed
@throws \Cake\Core\Exception\Exception
Resolves configured strategy .