CookieTrait::withCookieParams()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 2
b 0
f 0
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
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