Completed
Push — layout-caching ( bff40d...dc5564 )
by Kamil
67:32 queued 46:25
created

SessionStorage::remove()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sylius\Bundle\ResourceBundle\Storage;
13
14
use Sylius\Component\Resource\Storage\StorageInterface;
15
use Symfony\Component\HttpFoundation\Session\SessionInterface;
16
17
/**
18
 * @author Kamil Kokot <[email protected]>
19
 */
20
final class SessionStorage implements StorageInterface
21
{
22
    /**
23
     * @var SessionInterface
24
     */
25
    private $session;
26
27
    /**
28
     * @param SessionInterface $session
29
     */
30
    public function __construct(SessionInterface $session)
31
    {
32
        $this->session = $session;
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function has($name)
39
    {
40
        return $this->session->has($name);
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46
    public function get($name, $default = null)
47
    {
48
        return $this->session->get($name, $default);
49
    }
50
51
    /**
52
     * {@inheritdoc}
53
     */
54
    public function set($name, $value)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
55
    {
56
        return $this->session->set($name, $value);
57
    }
58
59
    /**
60
     * {@inheritdoc}
61
     */
62
    public function remove($name)
63
    {
64
        $this->session->remove($name);
65
    }
66
67
    /**
68
     * {@inheritdoc}
69
     */
70
    public function all()
71
    {
72
        return $this->session->all();
73
    }
74
}
75