CookieFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 20
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 4 1
A parse() 0 6 1
1
<?php
2
3
/*
4
 * This file is part of the Ivory Http Adapter package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Ivory\HttpAdapter\Event\Cookie;
13
14
use Ivory\HttpAdapter\Parser\CookieParser;
15
16
/**
17
 * @author GeLo <[email protected]>
18
 */
19
class CookieFactory implements CookieFactoryInterface
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24 270
    public function create($name, $value, array $attributes, $createdAt)
25
    {
26 270
        return new Cookie($name, $value, $attributes, $createdAt);
27
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32 216
    public function parse($header)
33
    {
34 216
        list($name, $value, $attributes) = CookieParser::parse($header);
35
36 216
        return $this->create($name, $value, $attributes, time());
37
    }
38
}
39