LocaleServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 4
c 1
b 0
f 0
dl 0
loc 22
rs 10
ccs 0
cts 8
cp 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A registerLocale() 0 3 1
A register() 0 3 1
A provides() 0 3 1
1
<?php
2
3
namespace Nip\Locale;
4
5
use Nip\Container\ServiceProvider\AbstractSignatureServiceProvider;
6
7
/**
8
 * Class LocaleServiceProvider
9
 * @package Nip\Mail
10
 */
11
class LocaleServiceProvider extends AbstractSignatureServiceProvider
0 ignored issues
show
Deprecated Code introduced by
The class Nip\Container\ServicePro...ignatureServiceProvider has been deprecated: use \Nip\Container\ServiceProviders\Providers\AbstractSignatureServiceProvider ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

11
class LocaleServiceProvider extends /** @scrutinizer ignore-deprecated */ AbstractSignatureServiceProvider
Loading history...
12
{
13
14
    /**
15
     * @inheritdoc
16
     */
17
    public function register()
18
    {
19
        $this->registerLocale();
20
    }
21
22
    protected function registerLocale()
23
    {
24
        $this->getContainer()->singleton('locale', Locale::class);
0 ignored issues
show
Bug introduced by
The method singleton() does not exist on Nip\Container\ContainerInterface. It seems like you code against a sub-type of Nip\Container\ContainerInterface such as Nip\Container\Container or Nip\Container\Container. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

24
        $this->getContainer()->/** @scrutinizer ignore-call */ singleton('locale', Locale::class);
Loading history...
25
    }
26
27
    /**
28
     * @inheritdoc
29
     */
30
    public function provides()
31
    {
32
        return ['locale'];
33
    }
34
}
35