Test Failed
Push — master ( f82b48...e7e248 )
by Maximo
03:08
created

QueueProvider::register()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 1
dl 0
loc 12
rs 10
c 0
b 0
f 0
1
<?php
0 ignored issues
show
Coding Style introduced by
End of line character is invalid; expected "\n" but found "\r\n"
Loading history...
2
3
namespace Gewaer\Providers;
4
5
use Phalcon\Di\ServiceProviderInterface;
6
use Phalcon\DiInterface;
7
use Phalcon\Queue\Beanstalk\Extended as Beanstalk;
8
use function Gewaer\Core\envValue;
9
10
class QueueProvider implements ServiceProviderInterface
11
{
12
    /**
13
     * @param DiInterface $container
14
     */
15
    public function register(DiInterface $container)
16
    {
17
        $container->setShared(
18
            'queue',
19
            function () {
20
                //Connect to the queue
21
                $queue = new Beanstalk([
22
                    'host' => envValue('DATA_API_BEANSTALK_HOST', '127.0.0.1'),
23
                    'prefix' => envValue('DATA_API_BEANSTALK_PORT', 11300),
24
                ]);
25
26
                return $queue;
27
            }
28
        );
29
    }
30
}
31