Completed
Push — bridge-refactor ( 54fa11 )
by Sullivan
05:53
created

IsoCodesValidatorServiceProvider   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 22
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 3 1
A register() 0 9 3
1
<?php
2
3
namespace SLLH\IsoCodesValidator\Provider;
4
5
use Silex\Application;
6
use Silex\ServiceProviderInterface;
7
8
/**
9
 * @author Sullivan Senechal <[email protected]>
10
 */
11
class IsoCodesValidatorServiceProvider implements ServiceProviderInterface
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16
    public function register(Application $app)
17
    {
18
        if (isset($app['translator'])) {
19
            $file = __DIR__.'/../Resources/translations/validators.'.$app['locale'].'.xlf';
20
            if (file_exists($file)) {
21
                $app['translator']->addResource('xliff', $file, $app['locale'], 'validators');
22
            }
23
        }
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function boot(Application $app)
30
    {
31
    }
32
}
33