SaxulumCrudProvider::register()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 15
rs 9.4286
cc 1
eloc 9
nc 1
nop 1
1
<?php
2
3
namespace Saxulum\Crud\Provider;
4
5
use Pimple\Container;
6
use Pimple\ServiceProviderInterface;
7
use Saxulum\Crud\Listing\ListingFactory;
8
use Saxulum\Crud\Listing\Type\ArrayType;
9
use Saxulum\Crud\Listing\Type\FloatType;
10
use Saxulum\Crud\Listing\Type\IntegerType;
11
use Saxulum\Crud\Listing\Type\StringType;
12
13
class SaxulumCrudProvider implements ServiceProviderInterface
14
{
15
    public function register(Container $pimple)
16
    {
17
        $pimple['saxulum.crud.listing.types'] = function(){
18
            return array(
19
                new ArrayType(),
20
                new FloatType(),
21
                new IntegerType(),
22
                new StringType(),
23
            );
24
        };
25
26
        $pimple['saxulum.crud.listing.factory'] = function() use ($pimple) {
27
            return new ListingFactory($pimple['saxulum.crud.listing.types']);
28
        };
29
    }
30
}
31