protected function _create($class, $alias, $settings)
    {
        if (is_callable($class)) {
            $class = $class($alias);
        }

        if (is_object($class)) {
            $instance = $class;
        }

        if (!isset($instance)) {
            $key = PHP_SAPI === 'cli' ? 'stdout' : 'default';
            $logger = Hash::get($settings, 'logger', $key);
            if (!($logger instanceof LoggerInterface)) {
                $logger = Log::engine($logger);
            }
            if (!($logger instanceof LoggerInterface)) {
                $logger = Log::engine('debug');
            }

            if ($logger === false) {
                $logger = null;
            }

            $instance = new $class($logger, $settings);
        }

        if ($instance instanceof EngineInterface) {
            return $instance;
        }

        throw new RuntimeException(
            'Queue Engines must implement josegonzalez\Queuesadilla\Engine\EngineInterface.'
        );
    }
protected function _create($class, $alias, $settings)
    {
        if (is_callable($class)) {
            $class = $class($alias);
        }

        if (is_object($class)) {
            $instance = $class;
        }

        if (!isset($instance)) {
            $key = PHP_SAPI === 'cli' ? 'stdout' : 'default';
            $logger = Hash::get($settings, 'logger', $key);
            if (!($logger instanceof LoggerInterface)) {
                $logger = Log::engine($logger);
            }
            if (!($logger instanceof LoggerInterface)) {
                $logger = Log::engine('debug');
            }

            if ($logger === false) {
                $logger = null;
            }

            $instance = new $class($logger, $settings);
        }

        if ($instance instanceof EngineInterface) {
            return $instance;
        }

        throw new RuntimeException(
            'Queue Engines must implement josegonzalez\Queuesadilla\Engine\EngineInterface.'
        );
    }
protected function _create ( $ class , $ alias , $ settings ) { if ( is_callable ( $ class ) ) { $ class = $ class ( $ alias ) ; } if ( is_object ( $ class ) ) { $ instance = $ class ; } if ( ! isset ( $ instance ) ) { $ key = PHP_SAPI === 'cli' ? 'stdout' : 'default' ; $ logger = Hash :: get ( $ settings , 'logger' , $ key ) ; if ( ! ( $ logger instanceof LoggerInterface ) ) { $ logger = Log :: engine ( $ logger ) ; } if ( ! ( $ logger instanceof LoggerInterface ) ) { $ logger = Log :: engine ( 'debug' ) ; } if ( $ logger === false ) { $ logger = null ; } $ instance = new $ class ( $ logger , $ settings ) ; } if ( $ instance instanceof EngineInterface ) { return $ instance ; } throw new RuntimeException ( 'Queue Engines must implement josegonzalez\Queuesadilla\Engine\EngineInterface.' ) ; }
Create the queue engine instance.

Part of the template method for Cake\Core\ObjectRegistry::load()

@param string|\josegonzalez\Queuesadilla\Engine\EngineInterface $class The classname or object to make.
@param string $alias The alias of the object.
@param array $settings An array of settings to use for the queue engine.
@return \josegonzalez\Queuesadilla\Engine\EngineInterface The constructed queue engine class.
@throws \RuntimeException when an object doesn't implement the correct interface.
Create the queue engine instance .