QueueProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 90.91%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 20
ccs 10
cts 11
cp 0.9091
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 15 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;
0 ignored issues
show
Bug introduced by
The type PhpAmqpLib\Connection\AMQPStreamConnection 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...
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', 'localhost'),
23 1
                    envValue('RABBITMQ_PORT', 5672),
24 1
                    envValue('RABBITMQ_DEFAULT_USER', 'guest'),
25 1
                    envValue('RABBITMQ_DEFAULT_PASS', 'guest'),
26
                    envValue('RABBITMQ_DEFAULT_VHOST', '/')
27
                );
28
29 1
                return $queue;
30
            }
31 1
        );
32
    }
33
}
34