ViewServiceProvider::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 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Nip\View;
6
7
use Nip\Container\ServiceProviders\Providers\AbstractServiceProvider;
8
9
/**
10
 * Class ViewServiceProvider.
11
 */
12
class ViewServiceProvider extends AbstractServiceProvider
13
{
14
    /**
15
     * Register the service provider.
16
     *
17
     * @return void
18 1
     */
19
    public function register()
20 1
    {
21 1
        $this->registerFactory();
22
    }
23 1
24
    public function registerFactory()
25 1
    {
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
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    public function provides()
33
    {
34
        return ['view', 'view.finder', 'view.factory'];
35
    }
36
}
37