Passed
Push — develop ( 6bc206...75605a )
by Carsten
10:11
created

PimpleServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 157
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 157
ccs 48
cts 48
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

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

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

17
        $dic['Profiles.Config'] = function( /** @scrutinizer ignore-unused */ $dic ) {

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

Loading history...
18
            $fieldconfig = (object) [
19 4
                'required' => [],
20 1
                'optional' => []
21 1
            ];
22
23
            return (object) [
24 4
                'reset'           => $fieldconfig,
25 4
                'change_password' => $fieldconfig,
26 4
                'change_profile'  => $fieldconfig,
27 4
                'login'           => $fieldconfig,
28 4
                'reset_password'  => $fieldconfig,
29 4
                'register'        => $fieldconfig,
30 4
                'signup'          => $fieldconfig,
31 4
                'edit_profile'    => $fieldconfig,
32 1
            ];
33
        };
34
35
        /**
36
         * @return StdClass
37
         */
38 3
        $dic['Profiles.Login'] = function( $dic ) {
39 4
            return $dic['Profiles.Config']->login;
40
        };
41
42
        /**
43
         * @return array
44
         */
45 3
        $dic['Profiles.Login.required'] = function( $dic ) {
46 4
            return (array) $dic['Profiles.Login']->required;
47
        };
48
49
50
51
        /**
52
         * @return StdClass
53
         */
54 3
        $dic['Profiles.ResetPassword'] = function( $dic ) {
55 4
            return $dic['Profiles.Config']->reset_password;
56
        };
57
58
        /**
59
         * @return array
60
         */
61 3
        $dic['Profiles.ResetPassword.required'] = function( $dic ) {
62 4
            return (array) $dic['Profiles.ResetPassword']->required;
63
        };
64
        /**
65
         * @return array
66
         */
67 3
        $dic['Profiles.ResetPassword.optional'] = function( $dic ) {
68 4
            return (array) $dic['Profiles.ResetPassword']->optional;
69
        };
70
71
72
73
74
        /**
75
         * @return StdClass
76
         */
77 3
        $dic['Profiles.Register'] = function( $dic ) {
78 4
            return $dic['Profiles.Config']->register;
79
        };
80
81
        /**
82
         * @return array
83
         */
84 3
        $dic['Profiles.Register.required'] = function( $dic ) {
85 4
            return (array) $dic['Profiles.Register']->required;
86
        };
87
88
        /**
89
         * @return array
90
         */
91 3
        $dic['Profiles.Register.optional'] = function( $dic ) {
92 4
            return (array) $dic['Profiles.Register']->optional;
93
        };
94
95
96
97
        /**
98
         * @return StdClass
99
         */
100 3
        $dic['Profiles.Signup'] = function( $dic ) {
101 4
            return $dic['Profiles.Config']->signup;
102
        };
103
104
        /**
105
         * @return array
106
         */
107 3
        $dic['Profiles.Signup.required'] = function( $dic ) {
108 4
            return (array) $dic['Profiles.Signup']->required;
109
        };
110
111
        /**
112
         * @return array
113
         */
114 3
        $dic['Profiles.Signup.optional'] = function( $dic ) {
115 4
            return (array) $dic['Profiles.Signup']->optional;
116
        };
117
118
119
120
121
        /**
122
         * @return StdClass
123
         */
124 3
        $dic['Profiles.ChangePassword'] = function( $dic ) {
125 4
            return $dic['Profiles.Config']->change_password;
126
        };
127
128
        /**
129
         * @return array
130
         */
131 3
        $dic['Profiles.ChangePassword.required'] = function( $dic ) {
132 4
            return (array) $dic['Profiles.ChangePassword']->required;
133
        };
134
        /**
135
         * @return array
136
         */
137 3
        $dic['Profiles.ChangePassword.optional'] = function( $dic ) {
138 4
            return (array) $dic['Profiles.ChangePassword']->optional;
139
        };
140
141
142
143
144
145
        /**
146
         * @return StdClass
147
         */
148 3
        $dic['Profiles.EditProfile'] = function( $dic ) {
149 4
            return $dic['Profiles.Config']->edit_profile;
150
        };
151
152
        /**
153
         * @return array
154
         */
155 3
        $dic['Profiles.EditProfile.required'] = function( $dic ) {
156 4
            return (array) $dic['Profiles.EditProfile']->required;
157
        };
158
159
        /**
160
         * @return array
161
         */
162 4
        $dic['Profiles.EditProfile.optional'] = function( $dic ) {
163 4
            return (array) $dic['Profiles.EditProfile']->optional;
164
        };
165
166 4
    }
167
168
}
169