| Conditions | 1 |
| Paths | 1 |
| Total Lines | 101 |
| Code Lines | 95 |
| 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 |
||
| 91 | private function addProvidersSection(ArrayNodeDefinition $rootNode): void |
||
| 92 | { |
||
| 93 | /** @var ArrayNodeDefinition $protoType */ |
||
| 94 | $protoType = $rootNode |
||
| 95 | ->children() |
||
| 96 | ->arrayNode('providers') |
||
| 97 | ->isRequired() |
||
| 98 | ->requiresAtLeastOneElement() |
||
| 99 | ->useAttributeAsKey('type') |
||
| 100 | ->prototype('array'); |
||
| 101 | |||
| 102 | $protoType |
||
| 103 | ->canBeDisabled() |
||
| 104 | ->children() |
||
| 105 | ->arrayNode('hosted') |
||
| 106 | ->children() |
||
| 107 | ->arrayNode('service_provider') |
||
| 108 | ->children() |
||
| 109 | ->scalarNode('public_key') |
||
| 110 | ->isRequired() |
||
| 111 | ->info('The absolute path to the public key used to sign AuthnRequests') |
||
| 112 | ->end() |
||
| 113 | ->scalarNode('private_key') |
||
| 114 | ->isRequired() |
||
| 115 | ->info('The absolute path to the private key used to sign AuthnRequests') |
||
| 116 | ->end() |
||
| 117 | ->end() |
||
| 118 | ->end() |
||
| 119 | ->arrayNode('identity_provider') |
||
| 120 | ->children() |
||
| 121 | ->scalarNode('service_provider_repository') |
||
| 122 | ->isRequired() |
||
| 123 | ->info( |
||
| 124 | 'Name of the service that is the Entity Repository. Must implement the ' |
||
| 125 | . ' Surfnet\SamlBundle\Entity\ServiceProviderRepository interface.' |
||
| 126 | ) |
||
| 127 | ->end() |
||
| 128 | ->scalarNode('public_key') |
||
| 129 | ->isRequired() |
||
| 130 | ->info('The absolute path to the public key used to sign Responses to AuthRequests with') |
||
| 131 | ->end() |
||
| 132 | ->scalarNode('private_key') |
||
| 133 | ->isRequired() |
||
| 134 | ->info('The absolute path to the private key used to sign Responses to AuthRequests with') |
||
| 135 | ->end() |
||
| 136 | ->end() |
||
| 137 | ->end() |
||
| 138 | ->arrayNode('metadata') |
||
| 139 | ->children() |
||
| 140 | ->scalarNode('public_key') |
||
| 141 | ->isRequired() |
||
| 142 | ->info('The absolute path to the public key used to sign the metadata') |
||
| 143 | ->end() |
||
| 144 | ->scalarNode('private_key') |
||
| 145 | ->isRequired() |
||
| 146 | ->info('The absolute path to the private key used to sign the metadata') |
||
| 147 | ->end() |
||
| 148 | ->end() |
||
| 149 | ->end() |
||
| 150 | ->end() |
||
| 151 | ->end() |
||
| 152 | ->arrayNode('remote') |
||
| 153 | ->children() |
||
| 154 | ->scalarNode('entity_id') |
||
| 155 | ->isRequired() |
||
| 156 | ->info('The EntityID of the remote identity provider') |
||
| 157 | ->end() |
||
| 158 | ->scalarNode('sso_url') |
||
| 159 | ->isRequired() |
||
| 160 | ->info('The name of the route to generate the SSO URL') |
||
| 161 | ->end() |
||
| 162 | ->scalarNode('certificate') |
||
| 163 | ->isRequired() |
||
| 164 | ->info( |
||
| 165 | 'The contents of the certificate used to sign the AuthnResponse with, if different from' |
||
| 166 | . ' the public key configured below' |
||
| 167 | ) |
||
| 168 | ->end() |
||
| 169 | ->end() |
||
| 170 | ->end() |
||
| 171 | ->arrayNode('view_config') |
||
| 172 | ->children() |
||
| 173 | ->scalarNode('logo') |
||
| 174 | ->isRequired() |
||
| 175 | ->info('The absolute path to the logo of the gssp') |
||
| 176 | ->end() |
||
| 177 | ->arrayNode('title') |
||
| 178 | ->children() |
||
| 179 | ->scalarNode('en_GB') |
||
| 180 | ->isRequired() |
||
| 181 | ->info('English title of the gssp') |
||
| 182 | ->end() |
||
| 183 | ->scalarNode('nl_NL') |
||
| 184 | ->isRequired() |
||
| 185 | ->info('Dutch title of the gssp') |
||
| 186 | ->end() |
||
| 187 | ->end() |
||
| 188 | ->end() |
||
| 189 | ->end() |
||
| 190 | ->end() |
||
| 191 | ->end(); |
||
| 192 | } |
||
| 194 |