| 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 |
||
| 99 | public function getSubClient( string $type, string $name = null ) : \Aimeos\Admin\JQAdm\Iface |
||
| 100 | { |
||
| 101 | /** admin/jqadm/customer/order/decorators/excludes |
||
| 102 | * Excludes decorators added by the "common" option from the customer JQAdm client |
||
| 103 | * |
||
| 104 | * Decorators extend the functionality of a class by adding new aspects |
||
| 105 | * (e.g. log what is currently done), executing the methods of the underlying |
||
| 106 | * class only in certain conditions (e.g. only for logged in users) or |
||
| 107 | * modify what is returned to the caller. |
||
| 108 | * |
||
| 109 | * This option allows you to remove a decorator added via |
||
| 110 | * "admin/jqadm/common/decorators/default" before they are wrapped |
||
| 111 | * around the JQAdm client. |
||
| 112 | * |
||
| 113 | * admin/jqadm/customer/order/decorators/excludes = array( 'decorator1' ) |
||
| 114 | * |
||
| 115 | * This would remove the decorator named "decorator1" from the list of |
||
| 116 | * common decorators ("\Aimeos\Admin\JQAdm\Common\Decorator\*") added via |
||
| 117 | * "admin/jqadm/common/decorators/default" to the JQAdm client. |
||
| 118 | * |
||
| 119 | * @param array List of decorator names |
||
| 120 | * @since 2017.07 |
||
| 121 | * @category Developer |
||
| 122 | * @see admin/jqadm/common/decorators/default |
||
| 123 | * @see admin/jqadm/customer/order/decorators/global |
||
| 124 | * @see admin/jqadm/customer/order/decorators/local |
||
| 125 | */ |
||
| 126 | |||
| 127 | /** admin/jqadm/customer/order/decorators/global |
||
| 128 | * Adds a list of globally available decorators only to the customer JQAdm client |
||
| 129 | * |
||
| 130 | * Decorators extend the functionality of a class by adding new aspects |
||
| 131 | * (e.g. log what is currently done), executing the methods of the underlying |
||
| 132 | * class only in certain conditions (e.g. only for logged in users) or |
||
| 133 | * modify what is returned to the caller. |
||
| 134 | * |
||
| 135 | * This option allows you to wrap global decorators |
||
| 136 | * ("\Aimeos\Admin\JQAdm\Common\Decorator\*") around the JQAdm client. |
||
| 137 | * |
||
| 138 | * admin/jqadm/customer/order/decorators/global = array( 'decorator1' ) |
||
| 139 | * |
||
| 140 | * This would add the decorator named "decorator1" defined by |
||
| 141 | * "\Aimeos\Admin\JQAdm\Common\Decorator\Decorator1" only to the JQAdm client. |
||
| 142 | * |
||
| 143 | * @param array List of decorator names |
||
| 144 | * @since 2017.07 |
||
| 145 | * @category Developer |
||
| 146 | * @see admin/jqadm/common/decorators/default |
||
| 147 | * @see admin/jqadm/customer/order/decorators/excludes |
||
| 148 | * @see admin/jqadm/customer/order/decorators/local |
||
| 149 | */ |
||
| 150 | |||
| 151 | /** admin/jqadm/customer/order/decorators/local |
||
| 152 | * Adds a list of local decorators only to the customer JQAdm client |
||
| 153 | * |
||
| 154 | * Decorators extend the functionality of a class by adding new aspects |
||
| 155 | * (e.g. log what is currently done), executing the methods of the underlying |
||
| 156 | * class only in certain conditions (e.g. only for logged in users) or |
||
| 157 | * modify what is returned to the caller. |
||
| 158 | * |
||
| 159 | * This option allows you to wrap local decorators |
||
| 160 | * ("\Aimeos\Admin\JQAdm\Customer\Decorator\*") around the JQAdm client. |
||
| 161 | * |
||
| 162 | * admin/jqadm/customer/order/decorators/local = array( 'decorator2' ) |
||
| 163 | * |
||
| 164 | * This would add the decorator named "decorator2" defined by |
||
| 165 | * "\Aimeos\Admin\JQAdm\Customer\Decorator\Decorator2" only to the JQAdm client. |
||
| 166 | * |
||
| 167 | * @param array List of decorator names |
||
| 168 | * @since 2017.07 |
||
| 169 | * @category Developer |
||
| 170 | * @see admin/jqadm/common/decorators/default |
||
| 171 | * @see admin/jqadm/customer/order/decorators/excludes |
||
| 172 | * @see admin/jqadm/customer/order/decorators/global |
||
| 173 | */ |
||
| 174 | return $this->createSubClient( 'customer/order/' . $type, $name ); |
||
| 175 | } |
||
| 274 |