Completed
Push — master ( 364388...0438cb )
by Neomerx
01:48
created

CookieFunctions   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 44
c 0
b 0
f 0
wmc 4
lcom 0
cbo 0
ccs 10
cts 10
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getWriteCookieCallable() 0 4 1
A setWriteCookieCallable() 0 6 1
A getWriteRawCookieCallable() 0 4 1
A setWriteRawCookieCallable() 0 6 1
1
<?php namespace Limoncello\Application\Cookies;
2
3
/**
4
 * Copyright 2015-2017 [email protected]
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 * http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
18
19
use Limoncello\Application\Contracts\Cookie\CookieFunctionsInterface;
20
21
/**
22
 * @package Limoncello\Application
23
 */
24
class CookieFunctions implements CookieFunctionsInterface
25
{
26
    /** @var callable */
27
    private $setCookieCallable = '\setcookie';
28
29
    /** @var callable */
30
    private $setRawCookieCallable = '\setrawcookie';
31
32
    /**
33
     * @inheritdoc
34
     */
35 1
    public function getWriteCookieCallable(): callable
36
    {
37 1
        return $this->setCookieCallable;
38
    }
39
40
    /**
41
     * @inheritdoc
42
     */
43 1
    public function setWriteCookieCallable(callable $callable): CookieFunctionsInterface
44
    {
45 1
        $this->setCookieCallable = $callable;
46
47 1
        return $this;
48
    }
49
50
    /**
51
     * @inheritdoc
52
     */
53 1
    public function getWriteRawCookieCallable(): callable
54
    {
55 1
        return $this->setRawCookieCallable;
56
    }
57
58
    /**
59
     * @inheritdoc
60
     */
61 1
    public function setWriteRawCookieCallable(callable $callable): CookieFunctionsInterface
62
    {
63 1
        $this->setRawCookieCallable = $callable;
64
65 1
        return $this;
66
    }
67
}
68