| Conditions | 1 |
| Paths | 1 |
| Total Lines | 80 |
| Code Lines | 78 |
| 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 |
||
| 62 | public function getNodeDefinition(NodeDefinition $node) |
||
| 63 | { |
||
| 64 | $node->children() |
||
| 65 | ->arrayNode($this->name()) |
||
| 66 | ->treatNullLike([]) |
||
| 67 | ->treatFalseLike([]) |
||
| 68 | ->useAttributeAsKey('name') |
||
| 69 | ->arrayPrototype() |
||
| 70 | ->children() |
||
| 71 | ->booleanNode('is_public') |
||
| 72 | ->info('If true, the service will be public, else private.') |
||
| 73 | ->defaultTrue() |
||
| 74 | ->end() |
||
| 75 | ->arrayNode('signature_algorithms') |
||
| 76 | ->info('A list of signature algorithm aliases.') |
||
| 77 | ->useAttributeAsKey('name') |
||
| 78 | ->isRequired() |
||
| 79 | ->scalarPrototype()->end() |
||
| 80 | ->end() |
||
| 81 | ->arrayNode('key_encryption_algorithms') |
||
| 82 | ->info('A list of key encryption algorithm aliases.') |
||
| 83 | ->useAttributeAsKey('name') |
||
| 84 | ->isRequired() |
||
| 85 | ->scalarPrototype()->end() |
||
| 86 | ->end() |
||
| 87 | ->arrayNode('content_encryption_algorithms') |
||
| 88 | ->info('A list of key encryption algorithm aliases.') |
||
| 89 | ->useAttributeAsKey('name') |
||
| 90 | ->isRequired() |
||
| 91 | ->scalarPrototype()->end() |
||
| 92 | ->end() |
||
| 93 | ->arrayNode('compression_methods') |
||
| 94 | ->info('A list of compression method aliases.') |
||
| 95 | ->useAttributeAsKey('name') |
||
| 96 | ->defaultValue(['DEF']) |
||
| 97 | ->scalarPrototype()->end() |
||
| 98 | ->end() |
||
| 99 | ->arrayNode('jws_serializers') |
||
| 100 | ->info('A list of JWS serializer aliases.') |
||
| 101 | ->useAttributeAsKey('name') |
||
| 102 | ->treatNullLike([]) |
||
| 103 | ->treatFalseLike([]) |
||
| 104 | ->isRequired() |
||
| 105 | ->requiresAtLeastOneElement() |
||
| 106 | ->scalarPrototype()->end() |
||
| 107 | ->end() |
||
| 108 | ->arrayNode('jwe_serializers') |
||
| 109 | ->info('A list of JWE serializer aliases.') |
||
| 110 | ->useAttributeAsKey('name') |
||
| 111 | ->treatNullLike([]) |
||
| 112 | ->treatFalseLike([]) |
||
| 113 | ->isRequired() |
||
| 114 | ->requiresAtLeastOneElement() |
||
| 115 | ->scalarPrototype()->end() |
||
| 116 | ->end() |
||
| 117 | ->arrayNode('jws_header_checkers') |
||
| 118 | ->info('A list of header checker aliases.') |
||
| 119 | ->useAttributeAsKey('name') |
||
| 120 | ->treatNullLike([]) |
||
| 121 | ->treatFalseLike([]) |
||
| 122 | ->scalarPrototype()->end() |
||
| 123 | ->end() |
||
| 124 | ->arrayNode('jwe_header_checkers') |
||
| 125 | ->info('A list of header checker aliases.') |
||
| 126 | ->useAttributeAsKey('name') |
||
| 127 | ->treatNullLike([]) |
||
| 128 | ->treatFalseLike([]) |
||
| 129 | ->scalarPrototype()->end() |
||
| 130 | ->end() |
||
| 131 | ->arrayNode('tags') |
||
| 132 | ->info('A list of tags to be associated to the service.') |
||
| 133 | ->useAttributeAsKey('name') |
||
| 134 | ->treatNullLike([]) |
||
| 135 | ->treatFalseLike([]) |
||
| 136 | ->variablePrototype()->end() |
||
| 137 | ->end() |
||
| 138 | ->end() |
||
| 139 | ->end() |
||
| 140 | ->end(); |
||
| 141 | } |
||
| 142 | |||
| 151 |