Completed
Push — master ( d2a888...751190 )
by Changwan
05:40 queued 01:26
created

CasterServiceProvider::boot()   A

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 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Wandu\Caster;
3
4
use Wandu\DI\ContainerInterface;
5
use Wandu\DI\ServiceProviderInterface;
6
use function Wandu\Foundation\config;
7
8
class CasterServiceProvider implements ServiceProviderInterface
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function register(ContainerInterface $app)
14
    {
15
        $app->closure(CastManagerInterface::class, function (ContainerInterface $app) {
16
            return new Caster(array_map(function ($caster) use ($app) {
17
                return $app->get($caster);
18
            }, config('caster.casters', [])));
19
        });
20
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function boot(ContainerInterface $app)
26
    {
27
    }
28
}
29