Test Failed
Branch add-core-tests (42298d)
by Rafael
10:47
created

QueueProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 88.89%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 9
c 3
b 0
f 0
dl 0
loc 19
ccs 8
cts 9
cp 0.8889
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 14 1
1
<?php
2
3
namespace Canvas\Providers;
4
5
use Phalcon\Di\ServiceProviderInterface;
0 ignored issues
show
Bug introduced by
The type Phalcon\Di\ServiceProviderInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Phalcon\DiInterface;
0 ignored issues
show
Bug introduced by
The type Phalcon\DiInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use Phalcon\Queue\Beanstalk\Extended as Beanstalk;
8
use PhpAmqpLib\Connection\AMQPStreamConnection;
9
use function Canvas\Core\envValue;
10
11
class QueueProvider implements ServiceProviderInterface
12
{
13
    /**
14
     * @param DiInterface $container
15
     */
16 2
    public function register(DiInterface $container)
17
    {
18 1
        $container->setShared(
19 1
            'queue',
20
            function () {
21
                //Connect to the queue
22 2
                $queue = new AMQPStreamConnection(
23 2
                    envValue('RABBITMQ_HOST'),
24 2
                    envValue('RABBITMQ_PORT'),
25 2
                    envValue('RABBITMQ_DEFAULT_USER'),
26 2
                    envValue('RABBITMQ_DEFAULT_PASS')
27
                );
28
29
                return $queue;
30 1
            }
31
         );
32
33
        /*  $container->setShared(
34
             'queue',
35
             function () {
36
                 //Connect to the queue
37
                 $queue = new Beanstalk([
38
                     'host' => envValue('DATA_API_BEANSTALK_HOST', '127.0.0.1'),
39
                     'prefix' => envValue('DATA_API_BEANSTALK_PORT', 11300),
40
                 ]);
41
                 return $queue;
42
             }
43
         ); */
44 1
    }
45
}
46