CacheDataProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 15
ccs 7
cts 7
cp 1
rs 10
c 4
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 10 1
1
<?php
2
3
namespace Canvas\Providers;
4
5
use function Canvas\Core\envValue;
6
use Phalcon\Cache\Backend\Libmemcached;
0 ignored issues
show
Bug introduced by
The type Phalcon\Cache\Backend\Libmemcached 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\Cache\Frontend\Data;
0 ignored issues
show
Bug introduced by
The type Phalcon\Cache\Frontend\Data 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 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...
9
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...
10
use Redis;
11
12
class CacheDataProvider implements ServiceProviderInterface
13
{
14
    /**
15
     * @param DiInterface $container
16 2
     */
17
    public function register(DiInterface $container)
18 2
    {
19 2
        $container->setShared(
20 2
            'cache',
21 1
            function () {
22 1
                //Connect to redis
23
                $redis = new Redis();
24 1
                $redis->connect(envValue('REDIS_HOST', '127.0.0.1'), (int) envValue('REDIS_PORT', 6379));
25
                $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP);
26
                return $redis;
27 1
            }
28
        );
29 1
    }
30
}
31