| Conditions | 1 |
| Paths | 1 |
| Total Lines | 189 |
| Code Lines | 184 |
| 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 |
||
| 67 | private function addProvidersSection(ArrayNodeDefinition $rootNode): void |
||
| 68 | { |
||
| 69 | /** @var ArrayNodeDefinition $protoType */ |
||
| 70 | $protoType = $rootNode |
||
| 71 | ->children() |
||
| 72 | ->arrayNode('providers') |
||
| 73 | ->isRequired() |
||
| 74 | ->requiresAtLeastOneElement() |
||
| 75 | ->useAttributeAsKey('type') |
||
| 76 | ->prototype('array'); |
||
| 77 | |||
| 78 | $protoType |
||
| 79 | ->children() |
||
| 80 | ->arrayNode('hosted') |
||
| 81 | ->children() |
||
| 82 | ->arrayNode('service_provider') |
||
| 83 | ->children() |
||
| 84 | ->scalarNode('public_key') |
||
| 85 | ->isRequired() |
||
| 86 | ->info('The absolute path to the public key used to sign AuthnRequests') |
||
| 87 | ->end() |
||
| 88 | ->scalarNode('private_key') |
||
| 89 | ->isRequired() |
||
| 90 | ->info('The absolute path to the private key used to sign AuthnRequests') |
||
| 91 | ->end() |
||
| 92 | ->end() |
||
| 93 | ->end() |
||
| 94 | ->arrayNode('metadata') |
||
| 95 | ->children() |
||
| 96 | ->scalarNode('public_key') |
||
| 97 | ->isRequired() |
||
| 98 | ->info('The absolute path to the public key used to sign the metadata') |
||
| 99 | ->end() |
||
| 100 | ->scalarNode('private_key') |
||
| 101 | ->isRequired() |
||
| 102 | ->info('The absolute path to the private key used to sign the metadata') |
||
| 103 | ->end() |
||
| 104 | ->end() |
||
| 105 | ->end() |
||
| 106 | ->end() |
||
| 107 | ->end() |
||
| 108 | ->arrayNode('remote') |
||
| 109 | ->children() |
||
| 110 | ->scalarNode('entity_id') |
||
| 111 | ->isRequired() |
||
| 112 | ->info('The EntityID of the remote identity provider') |
||
| 113 | ->end() |
||
| 114 | ->scalarNode('sso_url') |
||
| 115 | ->isRequired() |
||
| 116 | ->info('The name of the route to generate the SSO URL') |
||
| 117 | ->end() |
||
| 118 | ->scalarNode('certificate') |
||
| 119 | ->isRequired() |
||
| 120 | ->info( |
||
| 121 | 'The contents of the certificate used to sign the AuthnResponse with, if different from' |
||
| 122 | . ' the public key configured below' |
||
| 123 | ) |
||
| 124 | ->end() |
||
| 125 | ->end() |
||
| 126 | ->end() |
||
| 127 | ->arrayNode('view_config') |
||
| 128 | ->children() |
||
| 129 | ->scalarNode('loa') |
||
| 130 | ->isRequired() |
||
| 131 | ->info('The loa level (for now 1-3 are supported)') |
||
| 132 | ->end() |
||
| 133 | ->scalarNode('logo') |
||
| 134 | ->isRequired() |
||
| 135 | ->info('The absolute path to the logo of the gssp') |
||
| 136 | ->end() |
||
| 137 | ->scalarNode('app_android_url') |
||
| 138 | ->defaultFalse() |
||
| 139 | ->info('The optional Android app Play store URL') |
||
| 140 | ->end() |
||
| 141 | ->scalarNode('app_ios_url') |
||
| 142 | ->defaultFalse() |
||
| 143 | ->info('The optional iOs app Itunes store URL') |
||
| 144 | ->end() |
||
| 145 | ->arrayNode('alt') |
||
| 146 | ->children() |
||
| 147 | ->scalarNode('en_GB') |
||
| 148 | ->isRequired() |
||
| 149 | ->info('English alt text translation') |
||
| 150 | ->end() |
||
| 151 | ->scalarNode('nl_NL') |
||
| 152 | ->isRequired() |
||
| 153 | ->info('Dutch alt text translation') |
||
| 154 | ->end() |
||
| 155 | ->end() |
||
| 156 | ->end() |
||
| 157 | ->arrayNode('title') |
||
| 158 | ->children() |
||
| 159 | ->scalarNode('en_GB') |
||
| 160 | ->isRequired() |
||
| 161 | ->info('English title of the gssp') |
||
| 162 | ->end() |
||
| 163 | ->scalarNode('nl_NL') |
||
| 164 | ->isRequired() |
||
| 165 | ->info('Dutch title of the gssp') |
||
| 166 | ->end() |
||
| 167 | ->end() |
||
| 168 | ->end() |
||
| 169 | ->arrayNode('description') |
||
| 170 | ->children() |
||
| 171 | ->scalarNode('en_GB') |
||
| 172 | ->isRequired() |
||
| 173 | ->info('English description of the gssp') |
||
| 174 | ->end() |
||
| 175 | ->scalarNode('nl_NL') |
||
| 176 | ->isRequired() |
||
| 177 | ->info('Dutch description of the gssp') |
||
| 178 | ->end() |
||
| 179 | ->end() |
||
| 180 | ->end() |
||
| 181 | ->arrayNode('button_use') |
||
| 182 | ->children() |
||
| 183 | ->scalarNode('en_GB') |
||
| 184 | ->isRequired() |
||
| 185 | ->info('English text shown on the use button') |
||
| 186 | ->end() |
||
| 187 | ->scalarNode('nl_NL') |
||
| 188 | ->isRequired() |
||
| 189 | ->info('Dutch text shown on the use button') |
||
| 190 | ->end() |
||
| 191 | ->end() |
||
| 192 | ->end() |
||
| 193 | ->arrayNode('initiate_title') |
||
| 194 | ->children() |
||
| 195 | ->scalarNode('en_GB') |
||
| 196 | ->isRequired() |
||
| 197 | ->info('English initiate title text') |
||
| 198 | ->end() |
||
| 199 | ->scalarNode('nl_NL') |
||
| 200 | ->isRequired() |
||
| 201 | ->info('Dutch initiate title text') |
||
| 202 | ->end() |
||
| 203 | ->end() |
||
| 204 | ->end() |
||
| 205 | ->arrayNode('initiate_button') |
||
| 206 | ->children() |
||
| 207 | ->scalarNode('en_GB') |
||
| 208 | ->isRequired() |
||
| 209 | ->info('English initiate button text') |
||
| 210 | ->end() |
||
| 211 | ->scalarNode('nl_NL') |
||
| 212 | ->isRequired() |
||
| 213 | ->info('Dutch initiate button text') |
||
| 214 | ->end() |
||
| 215 | ->end() |
||
| 216 | ->end() |
||
| 217 | ->arrayNode('explanation') |
||
| 218 | ->children() |
||
| 219 | ->scalarNode('en_GB') |
||
| 220 | ->isRequired() |
||
| 221 | ->info('English explanation for step 2') |
||
| 222 | ->end() |
||
| 223 | ->scalarNode('nl_NL') |
||
| 224 | ->isRequired() |
||
| 225 | ->info('Dutch explanation for step 2') |
||
| 226 | ->end() |
||
| 227 | ->end() |
||
| 228 | ->end() |
||
| 229 | ->arrayNode('authn_failed') |
||
| 230 | ->children() |
||
| 231 | ->scalarNode('en_GB') |
||
| 232 | ->isRequired() |
||
| 233 | ->info('English text shown when authn request failed') |
||
| 234 | ->end() |
||
| 235 | ->scalarNode('nl_NL') |
||
| 236 | ->isRequired() |
||
| 237 | ->info('Dutch text shown when authn request failed') |
||
| 238 | ->end() |
||
| 239 | ->end() |
||
| 240 | ->end() |
||
| 241 | ->arrayNode('pop_failed') |
||
| 242 | ->children() |
||
| 243 | ->scalarNode('en_GB') |
||
| 244 | ->isRequired() |
||
| 245 | ->info('English text shown on failed proof of posession') |
||
| 246 | ->end() |
||
| 247 | ->scalarNode('nl_NL') |
||
| 248 | ->isRequired() |
||
| 249 | ->info('Dutch text shown on failed proof of posession') |
||
| 250 | ->end() |
||
| 251 | ->end() |
||
| 252 | ->end() |
||
| 253 | ->end() |
||
| 254 | ->end() |
||
| 255 | ->end(); |
||
| 256 | } |
||
| 258 |