Passed
Push — master ( eda60d...02421d )
by Pol
01:42
created

Extension::load()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 16
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 15
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 24
ccs 16
cts 16
cp 1
crap 1
rs 9.7666
1
<?php
2
3
declare(strict_types=1);
4
5
namespace loophp\phpspectime;
6
7
use loophp\phpspectime\Matcher\TakeInBetweenMatcher;
8
use loophp\phpspectime\Matcher\TakeLessThanMatcher;
9
use loophp\phpspectime\Matcher\TakeMoreThanMatcher;
10
use PhpSpec\Extension as ExtensionInterface;
11
use PhpSpec\ServiceContainer;
12
use PhpSpec\ServiceContainer\IndexedServiceContainer;
13
use Ubench;
14
15
final class Extension implements ExtensionInterface
16
{
17
    /**
18
     * @return void
19
     */
20 1
    public function load(ServiceContainer $container, array $params)
21
    {
22 1
        $container->define(
23 1
            'matchers.takeMoreThan',
24
            static function (IndexedServiceContainer $c) {
25 1
                return new TakeMoreThanMatcher($c->get('unwrapper'), $c->get('formatter.presenter'), new Ubench());
26 1
            },
27 1
            ['matchers']
28
        );
29
30 1
        $container->define(
31 1
            'matchers.takeLessThan',
32
            static function (IndexedServiceContainer $c) {
33 1
                return new TakeLessThanMatcher($c->get('unwrapper'), $c->get('formatter.presenter'), new Ubench());
34 1
            },
35 1
            ['matchers']
36
        );
37
38 1
        $container->define(
39 1
            'matchers.takeInBetween',
40
            static function (IndexedServiceContainer $c) {
41 1
                return new TakeInBetweenMatcher($c->get('unwrapper'), $c->get('formatter.presenter'), new Ubench());
42 1
            },
43 1
            ['matchers']
44
        );
45 1
    }
46
}
47