Completed
Push — master ( 39c1d7...699dc6 )
by Changwan
06:44
created

ValidatorServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 20
ccs 7
cts 7
cp 1
rs 10
c 1
b 0
f 1
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 7 1
A boot() 0 3 1
1
<?php
2
namespace Wandu\Validator;
3
4
use Wandu\DI\ContainerInterface;
5
use Wandu\DI\ServiceProviderInterface;
6
7
class ValidatorServiceProvider implements ServiceProviderInterface
8
{
9
    /**
10
     * {@inheritdoc}
11
     */
12
    public function register(ContainerInterface $app)
13
    {
14 2
        $app->closure(ValidatorFactory::class, function () {
15 1
            return validator();
16 2
        });
17 2
        $app->alias('validator', ValidatorFactory::class);
18 2
    }
19
20
    /**
21
     * {@inheritdoc}
22
     */
23 2
    public function boot(ContainerInterface $app)
24
    {
25 2
    }
26
}
27