Test Failed
Push — master ( e7e248...cb9afd )
by Maximo
02:40 queued 40s
created

SessionProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 16 1
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
8
class SessionProvider implements ServiceProviderInterface
9
{
10
    /**
11
     * @param DiInterface $container
12
     */
13
    public function register(DiInterface $container)
14
    {
15
        $container->setShared(
16
            'session',
17
            function () {
18
                $memcache = new \Phalcon\Session\Adapter\Memcache([
19
                    'host' => envValue('DATA_API_MEMCACHED_HOST', '127.0.0.1'),
0 ignored issues
show
Bug introduced by
The function envValue was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
                    'host' => /** @scrutinizer ignore-call */ envValue('DATA_API_MEMCACHED_HOST', '127.0.0.1'),
Loading history...
20
                    'post' => envValue('DATA_API_MEMCACHED_PORT', 11211),
21
                    'lifetime' => 8600, // optional (standard: 8600)
22
                    'prefix' => 'baka-api', // optional (standard: [empty_string]), means memcache key is my-app_31231jkfsdfdsfds3
23
                    'persistent' => false, // optional (standard: false)
24
                ]);
25
26
                $memcache->start();
27
28
                return $memcache;
29
            }
30
        );
31
    }
32
}
33