Passed
Push — master ( dc7db1...50d1ae )
by Gabriel
05:35 queued 12s
created

ViewServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 75%

Importance

Changes 2
Bugs 0 Features 2
Metric Value
eloc 4
c 2
b 0
f 2
dl 0
loc 25
ccs 6
cts 8
cp 0.75
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 3 1
A provides() 0 3 1
A registerFactory() 0 3 1
1
<?php
2
3
namespace Nip\View;
4
5
use Nip\Container\ServiceProviders\Providers\AbstractServiceProvider;
6
7
/**
8
 * Class ViewServiceProvider
9
 * @package Nip\View
10
 */
11
class ViewServiceProvider extends AbstractServiceProvider
12
{
13
14
    /**
15
     * Register the service provider.
16
     *
17
     * @return void
18
     */
19 1
    public function register()
20
    {
21 1
        $this->registerFactory();
22 1
    }
23
24 1
    public function registerFactory()
25
    {
26 1
        $this->getContainer()->singleton('view.factory', ViewFactory::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

26
        $this->getContainer()->/** @scrutinizer ignore-call */ singleton('view.factory', ViewFactory::class);
Loading history...
27 1
    }
28
29
30
    /**
31
     * @inheritdoc
32
     */
33
    public function provides()
34
    {
35
        return ['view', 'view.finder', 'view.factory'];
36
    }
37
}
38