ValidatorServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
ccs 2
cts 2
cp 1
cc 1
eloc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace OpenTribes\Core\Silex\Provider;
4
5
6
use OpenTribes\Core\Silex\Validator;
7
use Silex\Application;
8
use Silex\ServiceProviderInterface;
9
10
class ValidatorServiceProvider implements ServiceProviderInterface{
11
    /**
12
     * Registers services on the given app.
13
     *
14
     * This method should only be used to configure services and parameters.
15
     * It should not get services.
16
     */
17 35
    public function register(Application $app)
18
    {
19
        $app[Validator::LOGIN] = $app->share(function () use ($app) {
20 10
            return new Validator\SymfonyLoginValidator($app['validator']);
21 35
        });
22 35
        $app[Validator::REGISTRATION] = $app->share(function () use ($app) {
23 15
            return new Validator\SymfonyRegistrationValidator($app['validator']);
24 35
        });
25 35
    }
26
27
    /**
28
     * Bootstraps the application.
29
     *
30
     * This method is called after all services are registered
31
     * and should be used for "dynamic" configuration (whenever
32
     * a service must be requested).
33
     */
34 35
    public function boot(Application $app)
35
    {
36
37 35
    }
38
39
}