Completed
Push — master ( 4783ce...1821eb )
by Dennis
03:38
created

RandomItemAccessCase   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 28
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
benchRandomItemAccess() 0 1 ?
A provideRandomItemAccessIds() 0 10 2
1
<?php
2
3
/**
4
 * (c) Dennis Meckel
5
 *
6
 * For the full copyright and license information,
7
 * please view the LICENSE file that was distributed with this source code.
8
 */
9
10
namespace Rayne\wz2008\Graph\Benchmark;
11
12
use PhpBench\Benchmark\Metadata\Annotations\Groups;
13
use PhpBench\Benchmark\Metadata\Annotations\Iterations;
14
use PhpBench\Benchmark\Metadata\Annotations\ParamProviders;
15
use PhpBench\Benchmark\Metadata\Annotations\Revs;
16
use PhpBench\Benchmark\Metadata\Annotations\Warmup;
17
18
abstract class RandomItemAccessCase extends BaseCase
19
{
20
    /**
21
     * @Groups({"Random Access"})
22
     * @ParamProviders({"provideRandomItemAccessIds"})
23
     *
24
     * @Warmup(1)
25
     * @Revs(33)
26
     * @Iterations(3)
27
     *
28
     * @param $params
29
     */
30
    abstract public function benchRandomItemAccess($params);
31
32
    /**
33
     * @return array[]
34
     */
35
    public function provideRandomItemAccessIds()
36
    {
37
        $result = [];
38
39
        foreach (range('A', 'U') as $levelOneId) {
40
            $result[] = ['id' => $levelOneId];
41
        }
42
43
        return $result;
44
    }
45
}
46