Conditions | 1 |
Paths | 1 |
Total Lines | 76 |
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 |
||
134 | public function getSubClient( string $type, string $name = null ) : \Aimeos\Admin\JQAdm\Iface |
||
135 | { |
||
136 | /** admin/jqadm/type/attribute/property/decorators/excludes |
||
137 | * Excludes decorators added by the "common" option from the list type JQAdm client |
||
138 | * |
||
139 | * Decorators extend the functionality of a class by adding new aspects |
||
140 | * (e.g. log what is currently done), executing the methods of the underlying |
||
141 | * class only in certain conditions (e.g. only for logged in users) or |
||
142 | * modify what is returned to the caller. |
||
143 | * |
||
144 | * This option allows you to remove a decorator added via |
||
145 | * "client/jqadm/common/decorators/default" before they are wrapped |
||
146 | * around the JQAdm client. |
||
147 | * |
||
148 | * admin/jqadm/type/attribute/property/decorators/excludes = array( 'decorator1' ) |
||
149 | * |
||
150 | * This would remove the decorator named "decorator1" from the list of |
||
151 | * common decorators ("\Aimeos\Admin\JQAdm\Common\Decorator\*") added via |
||
152 | * "client/jqadm/common/decorators/default" to the JQAdm client. |
||
153 | * |
||
154 | * @param array List of decorator names |
||
155 | * @since 2018.01 |
||
156 | * @category Developer |
||
157 | * @see admin/jqadm/common/decorators/default |
||
158 | * @see admin/jqadm/type/attribute/property/decorators/global |
||
159 | * @see admin/jqadm/type/attribute/property/decorators/local |
||
160 | */ |
||
161 | |||
162 | /** admin/jqadm/type/attribute/property/decorators/global |
||
163 | * Adds a list of globally available decorators only to the list type JQAdm client |
||
164 | * |
||
165 | * Decorators extend the functionality of a class by adding new aspects |
||
166 | * (e.g. log what is currently done), executing the methods of the underlying |
||
167 | * class only in certain conditions (e.g. only for logged in users) or |
||
168 | * modify what is returned to the caller. |
||
169 | * |
||
170 | * This option allows you to wrap global decorators |
||
171 | * ("\Aimeos\Admin\JQAdm\Common\Decorator\*") around the JQAdm client. |
||
172 | * |
||
173 | * admin/jqadm/type/attribute/property/decorators/global = array( 'decorator1' ) |
||
174 | * |
||
175 | * This would add the decorator named "decorator1" defined by |
||
176 | * "\Aimeos\Admin\JQAdm\Common\Decorator\Decorator1" only to the JQAdm client. |
||
177 | * |
||
178 | * @param array List of decorator names |
||
179 | * @since 2018.01 |
||
180 | * @category Developer |
||
181 | * @see admin/jqadm/common/decorators/default |
||
182 | * @see admin/jqadm/type/attribute/property/decorators/excludes |
||
183 | * @see admin/jqadm/type/attribute/property/decorators/local |
||
184 | */ |
||
185 | |||
186 | /** admin/jqadm/type/attribute/property/decorators/local |
||
187 | * Adds a list of local decorators only to the list type JQAdm client |
||
188 | * |
||
189 | * Decorators extend the functionality of a class by adding new aspects |
||
190 | * (e.g. log what is currently done), executing the methods of the underlying |
||
191 | * class only in certain conditions (e.g. only for logged in users) or |
||
192 | * modify what is returned to the caller. |
||
193 | * |
||
194 | * This option allows you to wrap local decorators |
||
195 | * ("\Aimeos\Admin\JQAdm\Attribute\Propertytype\Decorator\*") around the JQAdm client. |
||
196 | * |
||
197 | * admin/jqadm/type/attribute/property/decorators/local = array( 'decorator2' ) |
||
198 | * |
||
199 | * This would add the decorator named "decorator2" defined by |
||
200 | * "\Aimeos\Admin\JQAdm\Attribute\Propertytype\Decorator\Decorator2" only to the JQAdm client. |
||
201 | * |
||
202 | * @param array List of decorator names |
||
203 | * @since 2018.01 |
||
204 | * @category Developer |
||
205 | * @see admin/jqadm/common/decorators/default |
||
206 | * @see admin/jqadm/type/attribute/property/decorators/excludes |
||
207 | * @see admin/jqadm/type/attribute/property/decorators/global |
||
208 | */ |
||
209 | return $this->createSubClient( 'type/attribute/property' . $type, $name ); |
||
210 | } |
||
290 |
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.