CookieTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 6
c 2
b 0
f 0
dl 0
loc 14
ccs 5
cts 5
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A withCookieParams() 0 5 1
A getCookieParams() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of the Koded package.
5
 *
6
 * (c) Mihail Binev <[email protected]>
7
 *
8
 * Please view the LICENSE distributed with this source code
9
 * for the full copyright and license information.
10
 *
11
 */
12
13
namespace Koded\Http;
14
15
trait CookieTrait
16
{
17
    protected array $cookieParams = [];
18
19
    public function getCookieParams(): array
20 4
    {
21
        return $this->cookieParams;
22 4
    }
23
24
    public function withCookieParams(array $cookies): static
25 2
    {
26
        $instance               = clone $this;
27 2
        $instance->cookieParams = $cookies;
28 2
        return $instance;
29
    }
30
}
31