GroupCountBased::setData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
crap 1
nc 1
nop 1
1
<?php declare(strict_types=1);
2
3
namespace Limoncello\Core\Routing\Dispatcher;
4
5
/**
6
 * Copyright 2015-2020 [email protected]
7
 *
8
 * Licensed under the Apache License, Version 2.0 (the "License");
9
 * you may not use this file except in compliance with the License.
10
 * You may obtain a copy of the License at
11
 *
12
 * http://www.apache.org/licenses/LICENSE-2.0
13
 *
14
 * Unless required by applicable law or agreed to in writing, software
15
 * distributed under the License is distributed on an "AS IS" BASIS,
16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
 * See the License for the specific language governing permissions and
18
 * limitations under the License.
19
 */
20
21
use Limoncello\Contracts\Routing\DispatcherInterface;
22
use Limoncello\Core\Routing\Traits\DispatcherTrait;
23
use function assert;
24
25
/**
26
 * @package Limoncello\Core
27
 */
28 View Code Duplication
class GroupCountBased extends \FastRoute\Dispatcher\GroupCountBased implements DispatcherInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
29
{
30
    use DispatcherTrait;
31
32
    /** @noinspection PhpMissingParentConstructorInspection
33
     * Constructor.
34
     */
35 12
    public function __construct()
36
    {
37 12
        assert($this->areCodeValid() === true);
38
39
        // Suppress parent constructor. Use `setData` instead.
40
    }
41
42
    /**
43
     * @inheritdoc
44
     */
45 12
    public function setData(array $data): void
46
    {
47 12
        list($this->staticRouteMap, $this->variableRouteData) = $data;
48
    }
49
}
50