Completed
Push — master ( 09ed12...283542 )
by Changwan
03:07
created

PhiewServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 23
ccs 0
cts 13
cp 0
rs 10
wmc 2
lcom 0
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 10 1
A boot() 0 3 1
1
<?php
2
namespace Wandu\View;
3
4
use Wandu\DI\ContainerInterface;
5
use Wandu\DI\ServiceProviderInterface;
6
use Wandu\View\Contracts\RenderInterface;
7
use function Wandu\Foundation\config;
8
use Wandu\View\Phiew\Configuration;
9
use Wandu\View\Phiew\Contracts\ResolverInterface;
10
use Wandu\View\Phiew\FileResolver;
11
12
class PhiewServiceProvider implements ServiceProviderInterface
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17
    public function register(ContainerInterface $app)
18
    {
19
        $app->closure(Configuration::class, function () {
20
            $conf = new Configuration();
21
            $conf->path[] = 'views';
22
            return $conf;
23
        });
24
        $app->bind(ResolverInterface::class, FileResolver::class);
25
        $app->bind(RenderInterface::class, Phiew::class);
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function boot(ContainerInterface $app)
32
    {
33
    }
34
}
35