Test Failed
Push — master ( af6147...dbfe7c )
by Maximo
11:22 queued 06:20
created

QueueProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 90%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 9
c 3
b 0
f 0
dl 0
loc 19
ccs 9
cts 10
cp 0.9
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 PhpAmqpLib\Connection\AMQPStreamConnection;
8
use function Canvas\Core\envValue;
9
10
class QueueProvider implements ServiceProviderInterface
11
{
12
    /**
13
     * @param DiInterface $container
14
     */
15 1
    public function register(DiInterface $container)
16
    {
17 1
        $container->setShared(
18 1
            'queue',
19 1
            function () {
20
                //Connect to the queue
21 1
                $queue = new AMQPStreamConnection(
22 1
                    envValue('RABBITMQ_HOST'),
23 1
                    envValue('RABBITMQ_PORT'),
24 1
                    envValue('RABBITMQ_DEFAULT_USER'),
25 1
                    envValue('RABBITMQ_DEFAULT_PASS')
26
                );
27
28
                return $queue;
29 1
            }
30
        );
31 1
    }
32
}
33