BestCase   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 19
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A add() 0 3 1
A __invoke() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of DivineNii opensource projects.
7
 *
8
 * PHP version 7.4 and above required
9
 *
10
 * @author    Divine Niiquaye Ibok <[email protected]>
11
 * @copyright 2019 DivineNii (https://divinenii.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 App\BenchMark\Strategy;
19
20
class BestCase implements CaseInterface
21
{
22
    /** @var array<string,array<string,array<int,string[]>>> */
23
    protected array $ids;
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function __invoke(string $method, string $host = '*')
29
    {
30
        return \reset($this->ids[$host][$method]);
31
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36
    public function add(array $ids): void
37
    {
38
        $this->ids = $ids;
39
    }
40
}
41