src/DependencyInjection/UecodeQPushExtension.php
private function createIronMQClient($config, ContainerBuilder $container, $name)
    {
        $service = sprintf('uecode_qpush.provider.%s', $name);

        if (!$container->hasDefinition($service)) {

            if (!class_exists('IronMQ\IronMQ')) {
                throw new RuntimeException('You must require "iron-io/iron_mq" to use the Iron MQ provider.');
            }

            $ironmq = new Definition('IronMQ\IronMQ');
            $ironmq->setArguments([
                [
                    'token'         => $config['token'],
                    'project_id'    => $config['project_id'],
                    'host'          => sprintf('%s.iron.io', $config['host']),
                    'port'          => $config['port'],
                    'api_version'   => $config['api_version']
                ]
            ]);

            $container->setDefinition($service, $ironmq)->setPublic(false);
        }

        return new Reference($service);
    }
private function createIronMQClient($config, ContainerBuilder $container, $name)
    {
        $service = sprintf('uecode_qpush.provider.%s', $name);

        if (!$container->hasDefinition($service)) {

            if (!class_exists('IronMQ\IronMQ')) {
                throw new RuntimeException('You must require "iron-io/iron_mq" to use the Iron MQ provider.');
            }

            $ironmq = new Definition('IronMQ\IronMQ');
            $ironmq->setArguments([
                [
                    'token'         => $config['token'],
                    'project_id'    => $config['project_id'],
                    'host'          => sprintf('%s.iron.io', $config['host']),
                    'port'          => $config['port'],
                    'api_version'   => $config['api_version']
                ]
            ]);

            $container->setDefinition($service, $ironmq)->setPublic(false);
        }

        return new Reference($service);
    }
private function createIronMQClient ( $ config , ContainerBuilder $ container , $ name ) { $ service = sprintf ( 'uecode_qpush.provider.%s' , $ name ) ; if ( ! $ container -> hasDefinition ( $ service ) ) { if ( ! class_exists ( 'IronMQ\IronMQ' ) ) { throw new RuntimeException ( 'You must require "iron-io/iron_mq" to use the Iron MQ provider.' ) ; } $ ironmq = new Definition ( 'IronMQ\IronMQ' ) ; $ ironmq -> setArguments ( [ [ 'token' => $ config [ 'token' ] , 'project_id' => $ config [ 'project_id' ] , 'host' => sprintf ( '%s.iron.io' , $ config [ 'host' ] ) , 'port' => $ config [ 'port' ] , 'api_version' => $ config [ 'api_version' ] ] ] ) ; $ container -> setDefinition ( $ service , $ ironmq ) -> setPublic ( false ) ; } return new Reference ( $ service ) ; }
Creates a definition for the IronMQ provider

@param array            $config    A Configuration array for the provider
@param ContainerBuilder $container The container
@param string           $name      The provider key

@throws RuntimeException

@return Reference
Creates a definition for the IronMQ provider