Passed
Push — master ( bbbf0c...d384f9 )
by Jonathan
03:29
created

ContainerBench::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 1
c 1
b 1
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
use Gravatalonga\Container\Container;
6
7
/**
8
 * @Revs({1, 8, 64, 4096})
9
 * @BeforeMethods({"init"})
10
 */
11
class ContainerBench
12
{
13
    /**
14
     * @var Container
15
     */
16
    private $container;
17
18
    /**
19
     * @Iterations(5)
20
     */
21
    public function benchFactory()
22
    {
23
        $this->container->set('my-logger', static function () {
24
            return mt_rand(0, 1000);
25
        });
26
        $this->container->get('my-logger');
27
    }
28
29
    public function init()
30
    {
31
        $this->container = new Container();
32
    }
33
}
34