Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Illuminate\Session;
4
 
5
use BadMethodCallException;
6
use Illuminate\Contracts\Session\Session;
7
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
8
use Symfony\Component\HttpFoundation\Session\SessionInterface;
9
use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag;
10
 
11
class SymfonySessionDecorator implements SessionInterface
12
{
13
    /**
14
     * The underlying Laravel session store.
15
     *
16
     * @var \Illuminate\Session\Store
17
     */
18
    protected $store;
19
 
20
    /**
21
     * Create a new session decorator.
22
     *
23
     * @param  \Illuminate\Contracts\Session\Session  $store
24
     * @return void
25
     */
26
    public function __construct(Session $store)
27
    {
28
        $this->store = $store;
29
    }
30
 
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function start(): bool
35
    {
36
        return $this->store->start();
37
    }
38
 
39
    /**
40
     * {@inheritdoc}
41
     */
42
    public function getId(): string
43
    {
44
        return $this->store->getId();
45
    }
46
 
47
    /**
48
     * {@inheritdoc}
49
     */
50
    public function setId(string $id)
51
    {
52
        $this->store->setId($id);
53
    }
54
 
55
    /**
56
     * {@inheritdoc}
57
     */
58
    public function getName(): string
59
    {
60
        return $this->store->getName();
61
    }
62
 
63
    /**
64
     * {@inheritdoc}
65
     */
66
    public function setName(string $name)
67
    {
68
        $this->store->setName($name);
69
    }
70
 
71
    /**
72
     * {@inheritdoc}
73
     */
74
    public function invalidate(int $lifetime = null): bool
75
    {
76
        $this->store->invalidate();
77
 
78
        return true;
79
    }
80
 
81
    /**
82
     * {@inheritdoc}
83
     */
84
    public function migrate(bool $destroy = false, int $lifetime = null): bool
85
    {
86
        $this->store->migrate($destroy);
87
 
88
        return true;
89
    }
90
 
91
    /**
92
     * {@inheritdoc}
93
     */
94
    public function save()
95
    {
96
        $this->store->save();
97
    }
98
 
99
    /**
100
     * {@inheritdoc}
101
     */
102
    public function has(string $name): bool
103
    {
104
        return $this->store->has($name);
105
    }
106
 
107
    /**
108
     * {@inheritdoc}
109
     */
110
    public function get(string $name, mixed $default = null): mixed
111
    {
112
        return $this->store->get($name, $default);
113
    }
114
 
115
    /**
116
     * {@inheritdoc}
117
     */
118
    public function set(string $name, mixed $value)
119
    {
120
        $this->store->put($name, $value);
121
    }
122
 
123
    /**
124
     * {@inheritdoc}
125
     */
126
    public function all(): array
127
    {
128
        return $this->store->all();
129
    }
130
 
131
    /**
132
     * {@inheritdoc}
133
     */
134
    public function replace(array $attributes)
135
    {
136
        $this->store->replace($attributes);
137
    }
138
 
139
    /**
140
     * {@inheritdoc}
141
     */
142
    public function remove(string $name): mixed
143
    {
144
        return $this->store->remove($name);
145
    }
146
 
147
    /**
148
     * {@inheritdoc}
149
     */
150
    public function clear()
151
    {
152
        $this->store->flush();
153
    }
154
 
155
    /**
156
     * {@inheritdoc}
157
     */
158
    public function isStarted(): bool
159
    {
160
        return $this->store->isStarted();
161
    }
162
 
163
    /**
164
     * {@inheritdoc}
165
     */
166
    public function registerBag(SessionBagInterface $bag)
167
    {
168
        throw new BadMethodCallException('Method not implemented by Laravel.');
169
    }
170
 
171
    /**
172
     * {@inheritdoc}
173
     */
174
    public function getBag(string $name): SessionBagInterface
175
    {
176
        throw new BadMethodCallException('Method not implemented by Laravel.');
177
    }
178
 
179
    /**
180
     * {@inheritdoc}
181
     */
182
    public function getMetadataBag(): MetadataBag
183
    {
184
        throw new BadMethodCallException('Method not implemented by Laravel.');
185
    }
186
}