Completed
Push — master ( f70b57...5f6191 )
by Changwan
06:48
created

ValidatorServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Wandu\Validator;
3
4
use Wandu\DI\ContainerInterface;
5
use Wandu\DI\ServiceProvider;
6
7
class ValidatorServiceProvider extends ServiceProvider
8
{
9
    /** @var array */
10
    protected $testers = [];
11
    
12
    /**
13
     * {@inheritdoc}
14
     */
15 2
    public function register(ContainerInterface $app)
16
    {
17 2
        $app->bind(TesterLoader::class)->assign('testers', ['value' => $this->testers]);
18 2
        $app->bind(ValidatorFactory::class)->after(function (ValidatorFactory $factory) {
19 1
            return ValidatorFactory::$instance = $factory;
20 2
        });
21
    }
22
}
23