| Conditions | 1 | 
| Paths | 1 | 
| Total Lines | 77 | 
| Code Lines | 1 | 
| 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 | ||
| 115 | public function getSubClient( string $type, string $name = null ) : \Aimeos\Client\Html\Iface | ||
| 116 | 	{ | ||
| 117 | /** client/html/account/subscription/lists/decorators/excludes | ||
| 118 | * Excludes decorators added by the "common" option from the account subscription list html client | ||
| 119 | * | ||
| 120 | * Decorators extend the functionality of a class by adding new aspects | ||
| 121 | * (e.g. log what is currently done), executing the methods of the underlying | ||
| 122 | * class only in certain conditions (e.g. only for logged in users) or | ||
| 123 | * modify what is returned to the caller. | ||
| 124 | * | ||
| 125 | * This option allows you to remove a decorator added via | ||
| 126 | * "client/html/common/decorators/default" before they are wrapped | ||
| 127 | * around the html client. | ||
| 128 | * | ||
| 129 | * client/html/account/subscription/lists/decorators/excludes = array( 'decorator1' ) | ||
| 130 | * | ||
| 131 | * This would remove the decorator named "decorator1" from the list of | ||
| 132 | 		 * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via | ||
| 133 | * "client/html/common/decorators/default" to the html client. | ||
| 134 | * | ||
| 135 | * @param array List of decorator names | ||
| 136 | * @since 2018.04 | ||
| 137 | * @category Developer | ||
| 138 | * @see client/html/common/decorators/default | ||
| 139 | * @see client/html/account/subscription/lists/decorators/global | ||
| 140 | * @see client/html/account/subscription/lists/decorators/local | ||
| 141 | */ | ||
| 142 | |||
| 143 | /** client/html/account/subscription/lists/decorators/global | ||
| 144 | * Adds a list of globally available decorators only to the account subscription list html client | ||
| 145 | * | ||
| 146 | * Decorators extend the functionality of a class by adding new aspects | ||
| 147 | * (e.g. log what is currently done), executing the methods of the underlying | ||
| 148 | * class only in certain conditions (e.g. only for logged in users) or | ||
| 149 | * modify what is returned to the caller. | ||
| 150 | * | ||
| 151 | * This option allows you to wrap global decorators | ||
| 152 | 		 * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. | ||
| 153 | * | ||
| 154 | * client/html/account/subscription/lists/decorators/global = array( 'decorator1' ) | ||
| 155 | * | ||
| 156 | * This would add the decorator named "decorator1" defined by | ||
| 157 | * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. | ||
| 158 | * | ||
| 159 | * @param array List of decorator names | ||
| 160 | * @since 2018.04 | ||
| 161 | * @category Developer | ||
| 162 | * @see client/html/common/decorators/default | ||
| 163 | * @see client/html/account/subscription/lists/decorators/excludes | ||
| 164 | * @see client/html/account/subscription/lists/decorators/local | ||
| 165 | */ | ||
| 166 | |||
| 167 | /** client/html/account/subscription/lists/decorators/local | ||
| 168 | * Adds a list of local decorators only to the account subscription list html client | ||
| 169 | * | ||
| 170 | * Decorators extend the functionality of a class by adding new aspects | ||
| 171 | * (e.g. log what is currently done), executing the methods of the underlying | ||
| 172 | * class only in certain conditions (e.g. only for logged in users) or | ||
| 173 | * modify what is returned to the caller. | ||
| 174 | * | ||
| 175 | * This option allows you to wrap local decorators | ||
| 176 | 		 * ("\Aimeos\Client\Html\Account\Decorator\*") around the html client. | ||
| 177 | * | ||
| 178 | * client/html/account/subscription/lists/decorators/local = array( 'decorator2' ) | ||
| 179 | * | ||
| 180 | * This would add the decorator named "decorator2" defined by | ||
| 181 | * "\Aimeos\Client\Html\Account\Decorator\Decorator2" only to the html client. | ||
| 182 | * | ||
| 183 | * @param array List of decorator names | ||
| 184 | * @since 2018.04 | ||
| 185 | * @category Developer | ||
| 186 | * @see client/html/common/decorators/default | ||
| 187 | * @see client/html/account/subscription/lists/decorators/excludes | ||
| 188 | * @see client/html/account/subscription/lists/decorators/global | ||
| 189 | */ | ||
| 190 | |||
| 191 | return $this->createSubClient( 'account/subscription/lists/' . $type, $name ); | ||
| 192 | } | ||
| 265 |