Test Failed
Pull Request — master (#16)
by Divine Niiquaye
02:27
created

CachedData   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 27
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getCompiler() 0 3 1
A getData() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of Flight Routing.
7
 *
8
 * PHP version 7.1 and above required
9
 *
10
 * @author    Divine Niiquaye Ibok <[email protected]>
11
 * @copyright 2019 Biurad Group (https://biurad.com/)
12
 * @license   https://opensource.org/licenses/BSD-3-Clause License
13
 *
14
 * For the full copyright and license information, please view the LICENSE
15
 * file that was distributed with this source code.
16
 */
17
18
namespace Flight\Routing;
19
20
use Flight\Routing\Interfaces\RouteCompilerInterface;
21
use Flight\Routing\Interfaces\RouteMapInterface;
22
23
/**
24
 * This class is used to retrieve cached RouteCollection's data.
25
 *
26
 * @author Divine Niiquaye Ibok <[email protected]>
27
 */
28
class CachedData implements RouteMapInterface
29
{
30
    /** @var RouteCompilerInterface */
31
    private $compiler;
32
33
    /** @var array */
34
    private $collectionData;
35
36
    public function __construct(array $collectionData)
37
    {
38
        [$this->compiler, $this->collectionData] = $collectionData;
39
    }
40
41
    /**
42
     * {@inheritdoc}
43
     */
44
    public function getCompiler(): RouteCompilerInterface
45
    {
46
        return $this->compiler;
47
    }
48
49
    /**
50
     * {@inheritdoc}
51
     */
52
    public function getData(): array
53
    {
54
        return $this->collectionData;
55
    }
56
}
57