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

ParentItemAccessCase   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A provideChildAndParentIds() 0 9 1
benchColdParentItemAccess() 0 1 ?
beforeWarmParentItemAccess() 0 1 ?
benchWarmParentItemAccess() 0 1 ?
afterWarmParentItemAccess() 0 1 ?
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\AfterMethods;
13
use PhpBench\Benchmark\Metadata\Annotations\BeforeMethods;
14
use PhpBench\Benchmark\Metadata\Annotations\Groups;
15
use PhpBench\Benchmark\Metadata\Annotations\Iterations;
16
use PhpBench\Benchmark\Metadata\Annotations\ParamProviders;
17
use PhpBench\Benchmark\Metadata\Annotations\Revs;
18
use PhpBench\Benchmark\Metadata\Annotations\Warmup;
19
20
abstract class ParentItemAccessCase extends BaseCase
21
{
22
    /**
23
     * @return array[]
24
     */
25
    public function provideChildAndParentIds()
26
    {
27
        return [
28
            ['child' => '74.10.2', 'parent' => '74.10'],
29
            ['child' => '74.10', 'parent' => '74.1'],
30
            ['child' => '74.1', 'parent' => '74'],
31
            ['child' => '74', 'parent' => 'M'],
32
        ];
33
    }
34
35
    /**
36
     * @Groups({"Parent Access"})
37
     * @ParamProviders({"provideChildAndParentIds"})
38
     *
39
     * @Warmup(1)
40
     * @Revs(33)
41
     * @Iterations(3)
42
     *
43
     * @param array $params
44
     */
45
    abstract public function benchColdParentItemAccess(array $params);
46
47
    /**
48
     * @param array $params
49
     */
50
    abstract public function beforeWarmParentItemAccess(array $params);
51
52
    /**
53
     * @Groups({"Parent Access"})
54
     * @ParamProviders({"provideChildAndParentIds"})
55
     * @BeforeMethods({"beforeWarmParentItemAccess"})
56
     * @AfterMethods({"afterWarmParentItemAccess"})
57
     *
58
     * @Warmup(1)
59
     * @Revs(33)
60
     * @Iterations(3)
61
     *
62
     * @param array $params
63
     */
64
    abstract public function benchWarmParentItemAccess(array $params);
65
66
    /**
67
     * @param array $params
68
     */
69
    abstract public function afterWarmParentItemAccess(array $params);
70
}
71