| Conditions | 1 |
| Paths | 1 |
| Total Lines | 90 |
| Code Lines | 85 |
| 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 |
||
| 72 | private function addProvidersSection(ArrayNodeDefinition $rootNode) |
||
| 73 | { |
||
| 74 | /** @var ArrayNodeDefinition $protoType */ |
||
| 75 | $protoType = $rootNode |
||
| 76 | ->children() |
||
| 77 | ->arrayNode('providers') |
||
| 78 | ->isRequired() |
||
| 79 | ->requiresAtLeastOneElement() |
||
| 80 | ->useAttributeAsKey('type') |
||
| 81 | ->prototype('array'); |
||
| 82 | |||
| 83 | $protoType |
||
| 84 | ->children() |
||
| 85 | ->arrayNode('hosted') |
||
| 86 | ->children() |
||
| 87 | ->arrayNode('service_provider') |
||
| 88 | ->children() |
||
| 89 | ->scalarNode('public_key') |
||
| 90 | ->isRequired() |
||
| 91 | ->info('The absolute path to the public key used to sign AuthnRequests') |
||
| 92 | ->end() |
||
| 93 | ->scalarNode('private_key') |
||
| 94 | ->isRequired() |
||
| 95 | ->info('The absolute path to the private key used to sign AuthnRequests') |
||
| 96 | ->end() |
||
| 97 | ->end() |
||
| 98 | ->end() |
||
| 99 | ->arrayNode('metadata') |
||
| 100 | ->children() |
||
| 101 | ->scalarNode('public_key') |
||
| 102 | ->isRequired() |
||
| 103 | ->info('The absolute path to the public key used to sign the metadata') |
||
| 104 | ->end() |
||
| 105 | ->scalarNode('private_key') |
||
| 106 | ->isRequired() |
||
| 107 | ->info('The absolute path to the private key used to sign the metadata') |
||
| 108 | ->end() |
||
| 109 | ->end() |
||
| 110 | ->end() |
||
| 111 | ->end() |
||
| 112 | ->end() |
||
| 113 | ->arrayNode('remote') |
||
| 114 | ->children() |
||
| 115 | ->scalarNode('entity_id') |
||
| 116 | ->isRequired() |
||
| 117 | ->info('The EntityID of the remote identity provider') |
||
| 118 | ->end() |
||
| 119 | ->scalarNode('sso_url') |
||
| 120 | ->isRequired() |
||
| 121 | ->info('The name of the route to generate the SSO URL') |
||
| 122 | ->end() |
||
| 123 | ->scalarNode('certificate') |
||
| 124 | ->isRequired() |
||
| 125 | ->info( |
||
| 126 | 'The contents of the certificate used to sign the AuthnResponse with, if different from' |
||
| 127 | . ' the public key configured below' |
||
| 128 | ) |
||
| 129 | ->end() |
||
| 130 | ->end() |
||
| 131 | ->end() |
||
| 132 | ->arrayNode('view_config') |
||
| 133 | ->children() |
||
| 134 | ->scalarNode('loa') |
||
| 135 | ->isRequired() |
||
| 136 | ->info('The loa level (for now 1-3 are supported)') |
||
| 137 | ->end() |
||
| 138 | ->scalarNode('logo') |
||
| 139 | ->isRequired() |
||
| 140 | ->info('The absolute path to the logo of the gssp') |
||
| 141 | ->end() |
||
| 142 | ->scalarNode('alt') |
||
| 143 | ->isRequired() |
||
| 144 | ->info('The alt text of the gssp logo') |
||
| 145 | ->end() |
||
| 146 | ->scalarNode('title') |
||
| 147 | ->isRequired() |
||
| 148 | ->info('The title of the gssp') |
||
| 149 | ->end() |
||
| 150 | ->scalarNode('description') |
||
| 151 | ->isRequired() |
||
| 152 | ->info('The description of the gssp') |
||
| 153 | ->end() |
||
| 154 | ->scalarNode('button_use') |
||
| 155 | ->isRequired() |
||
| 156 | ->info('The text shown on the use button') |
||
| 157 | ->end() |
||
| 158 | ->end() |
||
| 159 | ->end() |
||
| 160 | ->end(); |
||
| 161 | } |
||
| 162 | } |
||
| 163 |