| Conditions | 1 |
| Paths | 1 |
| Total Lines | 67 |
| Code Lines | 65 |
| 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 |
||
| 64 | public function getNodeDefinition(NodeDefinition $node) |
||
| 65 | { |
||
| 66 | $node->children() |
||
| 67 | ->arrayNode($this->name()) |
||
| 68 | ->addDefaultsIfNotSet() |
||
| 69 | ->children() |
||
| 70 | ->arrayNode('none') |
||
| 71 | ->info('The "none" authentication method is designed for public clients') |
||
| 72 | ->canBeEnabled() |
||
| 73 | ->end() |
||
| 74 | ->arrayNode('client_secret_basic') |
||
| 75 | ->canBeEnabled() |
||
| 76 | ->children() |
||
| 77 | ->scalarNode('realm') |
||
| 78 | ->isRequired() |
||
| 79 | ->info('The realm displayed in the authentication header') |
||
| 80 | ->end() |
||
| 81 | ->integerNode('secret_lifetime') |
||
| 82 | ->defaultValue(60 * 60 * 24 * 14) |
||
| 83 | ->min(0) |
||
| 84 | ->info('Secret lifetime (in seconds; 0 = unlimited)') |
||
| 85 | ->end() |
||
| 86 | ->end() |
||
| 87 | ->end() |
||
| 88 | ->arrayNode('client_secret_post') |
||
| 89 | ->canBeEnabled() |
||
| 90 | ->children() |
||
| 91 | ->integerNode('secret_lifetime') |
||
| 92 | ->defaultValue(60 * 60 * 24 * 14) |
||
| 93 | ->min(0) |
||
| 94 | ->info('Secret lifetime (in seconds; 0 = unlimited)') |
||
| 95 | ->end() |
||
| 96 | ->end() |
||
| 97 | ->end() |
||
| 98 | ->arrayNode('client_assertion_jwt') |
||
| 99 | ->canBeEnabled() |
||
| 100 | ->info('This method comprises the "client_secret_jwt" and the "private_key_jwt" authentication methods') |
||
| 101 | ->children() |
||
| 102 | ->integerNode('secret_lifetime') |
||
| 103 | ->info('Secret lifetime (in seconds; 0 = unlimited) applicable to the "client_secret_jwt" authentication method') |
||
| 104 | ->defaultValue(60 * 60 * 24 * 14) |
||
| 105 | ->min(0) |
||
| 106 | ->end() |
||
| 107 | ->arrayNode('signature_algorithms') |
||
| 108 | ->info('Supported signature algorithms.') |
||
| 109 | ->useAttributeAsKey('name') |
||
| 110 | ->prototype('scalar')->end() |
||
| 111 | ->treatNullLike([]) |
||
| 112 | ->end() |
||
| 113 | ->arrayNode('claim_checkers') |
||
| 114 | ->info('Claim checkers for incoming assertions.') |
||
| 115 | ->useAttributeAsKey('name') |
||
| 116 | ->prototype('scalar')->end() |
||
| 117 | ->treatNullLike([]) |
||
| 118 | ->end() |
||
| 119 | ->arrayNode('header_checkers') |
||
| 120 | ->info('Header checkers for incoming assertions.') |
||
| 121 | ->useAttributeAsKey('name') |
||
| 122 | ->prototype('scalar')->end() |
||
| 123 | ->treatNullLike([]) |
||
| 124 | ->end() |
||
| 125 | ->end() |
||
| 126 | ->end() |
||
| 127 | ->end() |
||
| 128 | ->end() |
||
| 129 | ->end(); |
||
| 130 | } |
||
| 131 | |||
| 141 |