Passed
Push — implement_memcached_sessions ( 6ecce1 )
by Paweł
58:27 queued 27:27
created

DynamicDomainSessionStorage   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 26
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A setOptions() 0 8 1
1
<?php
2
3
/**
4
 * This file is part of the Superdesk Web Publisher Core Bundle.
5
 *
6
 * Copyright 2015 Sourcefabric z.u. and contributors.
7
 *
8
 * For the full copyright and license information, please see the
9
 * AUTHORS and LICENSE files distributed with this source code.
10
 *
11
 * @copyright 2015 Sourcefabric z.ú
12
 * @license http://www.superdesk.org/license
13
 */
14
namespace SWP\Bundle\CoreBundle\Security\Storage;
15
16
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
17
18
class DynamicDomainSessionStorage extends NativeSessionStorage
19
{
20
    /**
21
     * @var string
22
     */
23
    protected $domain;
24
25 1
    public function __construct(string $domain)
26
    {
27 1
        $this->domain = $domain;
28
29 1
        parent::__construct();
30 1
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35 1
    public function setOptions(array $options)
36
    {
37 1
        $options['cookie_domain'] = '.'.$this->domain;
38 1
        $options['cookie_httponly'] = true;
39 1
        $options['name'] = 'SUPERDESKPUBLISHER';
40
41 1
        parent::setOptions($options);
42 1
    }
43
}
44