LocaleServiceProvider::provides()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
ccs 0
cts 2
cp 0
cc 1
nc 1
nop 0
crap 2
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