Conditions | 1 |
Paths | 1 |
Total Lines | 126 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
75 | private function addProvidersSection(ArrayNodeDefinition $rootNode) |
||
76 | { |
||
77 | /** @var ArrayNodeDefinition $protoType */ |
||
78 | $protoType = $rootNode |
||
79 | ->children() |
||
80 | ->arrayNode('providers') |
||
81 | ->isRequired() |
||
82 | ->requiresAtLeastOneElement() |
||
83 | ->useAttributeAsKey('type') |
||
84 | ->prototype('array'); |
||
85 | |||
86 | $protoType |
||
87 | ->children() |
||
88 | ->arrayNode('hosted') |
||
89 | ->children() |
||
90 | ->arrayNode('service_provider') |
||
91 | ->children() |
||
92 | ->scalarNode('public_key') |
||
93 | ->isRequired() |
||
94 | ->info('The absolute path to the public key used to sign AuthnRequests') |
||
95 | ->end() |
||
96 | ->scalarNode('private_key') |
||
97 | ->isRequired() |
||
98 | ->info('The absolute path to the private key used to sign AuthnRequests') |
||
99 | ->end() |
||
100 | ->end() |
||
101 | ->end() |
||
102 | ->arrayNode('metadata') |
||
103 | ->children() |
||
104 | ->scalarNode('public_key') |
||
105 | ->isRequired() |
||
106 | ->info('The absolute path to the public key used to sign the metadata') |
||
107 | ->end() |
||
108 | ->scalarNode('private_key') |
||
109 | ->isRequired() |
||
110 | ->info('The absolute path to the private key used to sign the metadata') |
||
111 | ->end() |
||
112 | ->end() |
||
113 | ->end() |
||
114 | ->end() |
||
115 | ->end() |
||
116 | ->arrayNode('remote') |
||
117 | ->children() |
||
118 | ->scalarNode('entity_id') |
||
119 | ->isRequired() |
||
120 | ->info('The EntityID of the remote identity provider') |
||
121 | ->end() |
||
122 | ->scalarNode('sso_url') |
||
123 | ->isRequired() |
||
124 | ->info('The name of the route to generate the SSO URL') |
||
125 | ->end() |
||
126 | ->scalarNode('certificate') |
||
127 | ->isRequired() |
||
128 | ->info( |
||
129 | 'The contents of the certificate used to sign the AuthnResponse with, if different from' |
||
130 | . ' the public key configured below' |
||
131 | ) |
||
132 | ->end() |
||
133 | ->end() |
||
134 | ->end() |
||
135 | ->arrayNode('view_config') |
||
136 | ->children() |
||
137 | ->arrayNode('title') |
||
138 | ->children() |
||
139 | ->scalarNode('en_GB') |
||
140 | ->isRequired() |
||
141 | ->info('English gssp title translation') |
||
142 | ->end() |
||
143 | ->scalarNode('nl_NL') |
||
144 | ->isRequired() |
||
145 | ->info('Dutch gssp title translation') |
||
146 | ->end() |
||
147 | ->end() |
||
148 | ->end() |
||
149 | ->arrayNode('page_title') |
||
150 | ->children() |
||
151 | ->scalarNode('en_GB') |
||
152 | ->isRequired() |
||
153 | ->info('English page title translation') |
||
154 | ->end() |
||
155 | ->scalarNode('nl_NL') |
||
156 | ->isRequired() |
||
157 | ->info('Dutch alt page title translation') |
||
158 | ->end() |
||
159 | ->end() |
||
160 | ->end() |
||
161 | ->arrayNode('explanation') |
||
162 | ->children() |
||
163 | ->scalarNode('en_GB') |
||
164 | ->isRequired() |
||
165 | ->info('English explanation translation') |
||
166 | ->end() |
||
167 | ->scalarNode('nl_NL') |
||
168 | ->isRequired() |
||
169 | ->info('Dutch explanation translation') |
||
170 | ->end() |
||
171 | ->end() |
||
172 | ->end() |
||
173 | ->arrayNode('initiate') |
||
174 | ->children() |
||
175 | ->scalarNode('en_GB') |
||
176 | ->isRequired() |
||
177 | ->info('English initiate text translation') |
||
178 | ->end() |
||
179 | ->scalarNode('nl_NL') |
||
180 | ->isRequired() |
||
181 | ->info('Dutch initiate text translation') |
||
182 | ->end() |
||
183 | ->end() |
||
184 | ->end() |
||
185 | ->arrayNode('gssf_id_mismatch') |
||
186 | ->children() |
||
187 | ->scalarNode('en_GB') |
||
188 | ->isRequired() |
||
189 | ->info('English id mismatch text translation') |
||
190 | ->end() |
||
191 | ->scalarNode('nl_NL') |
||
192 | ->isRequired() |
||
193 | ->info('Dutch id mismatch text translation') |
||
194 | ->end() |
||
195 | ->end() |
||
196 | ->end() |
||
197 | ->end() |
||
198 | ->end() |
||
199 | ->end(); |
||
200 | } |
||
201 | } |
||
202 |
This check looks for function calls that miss required arguments.