PimpleServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 63
ccs 19
cts 19
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B register() 0 56 1
1
<?php
2
namespace Germania\UserRoles\Providers;
3
4
use Pimple\Container;
5
use Pimple\ServiceProviderInterface;
6
7
class PimpleServiceProvider implements ServiceProviderInterface
8
{
9
10
    /**
11
     * @implements ServiceProviderInterface
12
     */
13 1
    public function register(Container $dic)
14
    {
15
16
17
        /**
18
         * @return StdClass
19
         */
20 4
        $dic['Roles.Config'] = function( $dic ) {
0 ignored issues
show
Unused Code introduced by
The parameter $dic is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
21
            return (object) [
22 3
                'all' => [
23 2
                    'guest' =>      1,
24 1
                    'registered' => 2,
25 1
                    'superuser' =>  3,
26
                    'admin' =>      4
27 1
                ],
28
29 1
                "guests" => [ 1 ],
30 1
                "new_users" => [ 2 ]
31 1
            ];
32
        };
33
34
35 4
        $dic['Roles.pdo'] = function( $dic ) {
0 ignored issues
show
Unused Code introduced by
The parameter $dic is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
36 5
            return false;
37
        };
38
39
40
        /**
41
         * @return StdClass
42
         */
43 4
        $dic['Roles.all'] = function( $dic ) {
44 5
            return (object) $dic['Roles.Config']->all;
45
        };
46
47
48
        /**
49
         * @return array
50
         */
51 4
        $dic['Roles.guests'] = function( $dic ) {
52 5
            return $dic['Roles.Config']->guests;
53
        };
54
55
56
        /**
57
         * @return array
58
         */
59 5
        $dic['Roles.new_users'] = function( $dic ) {
60 5
            return $dic['Roles.Config']->new_users;
61
        };
62
63
64
65
66
67
68 5
    }
69
}
70
71