| Conditions | 1 |
| Paths | 1 |
| Total Lines | 77 |
| 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 |
||
| 81 | public function getSubClient( string $type, string $name = null ) : \Aimeos\Admin\JQAdm\Iface |
||
| 82 | { |
||
| 83 | /** admin/jqadm/dashboard/order/quick/countcompleted/decorators/excludes |
||
| 84 | * Excludes decorators added by the "common" option from the dashboard JQAdm client |
||
| 85 | * |
||
| 86 | * Decorators extend the functionality of a class by adding new aspects |
||
| 87 | * (e.g. log what is currently done), executing the methods of the underlying |
||
| 88 | * class only in certain conditions (e.g. only for logged in users) or |
||
| 89 | * modify what is returned to the caller. |
||
| 90 | * |
||
| 91 | * This option allows you to remove a decorator added via |
||
| 92 | * "admin/jqadm/common/decorators/default" before they are wrapped |
||
| 93 | * around the JQAdm client. |
||
| 94 | * |
||
| 95 | * admin/jqadm/dashboard/order/quick/countcompleted/decorators/excludes = array( 'decorator1' ) |
||
| 96 | * |
||
| 97 | * This would remove the decorator named "decorator1" from the list of |
||
| 98 | * common decorators ("\Aimeos\Admin\JQAdm\Common\Decorator\*") added via |
||
| 99 | * "admin/jqadm/common/decorators/default" to the JQAdm client. |
||
| 100 | * |
||
| 101 | * @param array List of decorator names |
||
| 102 | * @since 2021.04 |
||
| 103 | * @category Developer |
||
| 104 | * @see admin/jqadm/common/decorators/default |
||
| 105 | * @see admin/jqadm/dashboard/order/quick/countcompleted/decorators/global |
||
| 106 | * @see admin/jqadm/dashboard/order/quick/countcompleted/decorators/local |
||
| 107 | */ |
||
| 108 | |||
| 109 | /** admin/jqadm/dashboard/order/quick/countcompleted/decorators/global |
||
| 110 | * Adds a list of globally available decorators only to the dashboard JQAdm client |
||
| 111 | * |
||
| 112 | * Decorators extend the functionality of a class by adding new aspects |
||
| 113 | * (e.g. log what is currently done), executing the methods of the underlying |
||
| 114 | * class only in certain conditions (e.g. only for logged in users) or |
||
| 115 | * modify what is returned to the caller. |
||
| 116 | * |
||
| 117 | * This option allows you to wrap global decorators |
||
| 118 | * ("\Aimeos\Admin\JQAdm\Common\Decorator\*") around the JQAdm client. |
||
| 119 | * |
||
| 120 | * admin/jqadm/dashboard/order/quick/countcompleted/decorators/global = array( 'decorator1' ) |
||
| 121 | * |
||
| 122 | * This would add the decorator named "decorator1" defined by |
||
| 123 | * "\Aimeos\Admin\JQAdm\Common\Decorator\Decorator1" only to the JQAdm client. |
||
| 124 | * |
||
| 125 | * @param array List of decorator names |
||
| 126 | * @since 2021.04 |
||
| 127 | * @category Developer |
||
| 128 | * @see admin/jqadm/common/decorators/default |
||
| 129 | * @see admin/jqadm/dashboard/order/quick/countcompleted/decorators/excludes |
||
| 130 | * @see admin/jqadm/dashboard/order/quick/countcompleted/decorators/local |
||
| 131 | */ |
||
| 132 | |||
| 133 | /** admin/jqadm/dashboard/order/quick/countcompleted/decorators/local |
||
| 134 | * Adds a list of local decorators only to the dashboard JQAdm client |
||
| 135 | * |
||
| 136 | * Decorators extend the functionality of a class by adding new aspects |
||
| 137 | * (e.g. log what is currently done), executing the methods of the underlying |
||
| 138 | * class only in certain conditions (e.g. only for logged in users) or |
||
| 139 | * modify what is returned to the caller. |
||
| 140 | * |
||
| 141 | * This option allows you to wrap local decorators |
||
| 142 | * ("\Aimeos\Admin\JQAdm\Dashboard\Decorator\*") around the JQAdm client. |
||
| 143 | * |
||
| 144 | * admin/jqadm/dashboard/order/quick/countcompleted/decorators/local = array( 'decorator2' ) |
||
| 145 | * |
||
| 146 | * This would add the decorator named "decorator2" defined by |
||
| 147 | * "\Aimeos\Admin\JQAdm\Dashboard\Decorator\Decorator2" only to the JQAdm client. |
||
| 148 | * |
||
| 149 | * @param array List of decorator names |
||
| 150 | * @since 2021.04 |
||
| 151 | * @category Developer |
||
| 152 | * @see admin/jqadm/common/decorators/default |
||
| 153 | * @see admin/jqadm/dashboard/order/quick/countcompleted/decorators/excludes |
||
| 154 | * @see admin/jqadm/dashboard/order/quick/countcompleted/decorators/global |
||
| 155 | */ |
||
| 156 | return $this->createSubClient( 'dashboard/order/quick/countcompleted/' . $type, $name ); |
||
| 157 | } |
||
| 158 | |||
| 203 |