Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
Stores
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 apply
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace PeServer\Core\Store;
6
7use PeServer\Core\Web\WebSecurity;
8use PeServer\Core\Store\CookieStore;
9use PeServer\Core\Store\SessionStore;
10use PeServer\Core\Store\SpecialStore;
11use PeServer\Core\Store\TemporaryStore;
12
13/**
14 * クッキーとかあれこれ一覧。
15 */
16readonly class Stores
17{
18    #region variable
19
20    /** Cookie */
21    public CookieStore $cookie;
22    /** セッション */
23    public SessionStore $session;
24    /** 一時 */
25    public TemporaryStore $temporary;
26
27    #endregion
28
29    /**
30     * 生成。
31     *
32     * @param SpecialStore $special
33     * @param StoreOptions $options
34     */
35    public function __construct(
36        public SpecialStore $special,
37        private StoreOptions $options,
38        WebSecurity $webSecurity
39    ) {
40        $this->cookie = new CookieStore($this->special, $this->options->cookie);
41        $this->temporary = new TemporaryStore($this->options->temporary, $this->cookie);
42        $this->session = new SessionStore($this->options->session, $this->cookie, $webSecurity);
43    }
44
45    #region function
46
47    public function apply(): void
48    {
49        $this->session->apply();
50        $this->temporary->apply();
51        $this->cookie->apply();
52    }
53
54    #endregion
55}