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

DynamicDomainSessionStorage::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 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