Conditions | 1 |
Paths | 1 |
Total Lines | 76 |
Code Lines | 1 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 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 |
||
96 | public function getSubClient( string $type, string $name = null ) : \Aimeos\Admin\JQAdm\Iface |
||
97 | { |
||
98 | /** admin/jqadm/order/transaction/decorators/excludes |
||
99 | * Excludes decorators added by the "common" option from the order JQAdm client |
||
100 | * |
||
101 | * Decorators extend the functionality of a class by adding new aspects |
||
102 | * (e.g. log what is currently done), executing the methods of the underlying |
||
103 | * class only in certain conditions (e.g. only for logged in users) or |
||
104 | * modify what is returned to the caller. |
||
105 | * |
||
106 | * This option allows you to remove a decorator added via |
||
107 | * "admin/jqadm/common/decorators/default" before they are wrapped |
||
108 | * around the JQAdm client. |
||
109 | * |
||
110 | * admin/jqadm/order/transaction/decorators/excludes = array( 'decorator1' ) |
||
111 | * |
||
112 | * This would remove the decorator named "decorator1" from the list of |
||
113 | * common decorators ("\Aimeos\Admin\JQAdm\Common\Decorator\*") added via |
||
114 | * "admin/jqadm/common/decorators/default" to the JQAdm client. |
||
115 | * |
||
116 | * @param array List of decorator names |
||
117 | * @since 2023.01 |
||
118 | * @category Developer |
||
119 | * @see admin/jqadm/common/decorators/default |
||
120 | * @see admin/jqadm/order/transaction/decorators/global |
||
121 | * @see admin/jqadm/order/transaction/decorators/local |
||
122 | */ |
||
123 | |||
124 | /** admin/jqadm/order/transaction/decorators/global |
||
125 | * Adds a list of globally available decorators only to the order JQAdm client |
||
126 | * |
||
127 | * Decorators extend the functionality of a class by adding new aspects |
||
128 | * (e.g. log what is currently done), executing the methods of the underlying |
||
129 | * class only in certain conditions (e.g. only for logged in users) or |
||
130 | * modify what is returned to the caller. |
||
131 | * |
||
132 | * This option allows you to wrap global decorators |
||
133 | * ("\Aimeos\Admin\JQAdm\Common\Decorator\*") around the JQAdm client. |
||
134 | * |
||
135 | * admin/jqadm/order/transaction/decorators/global = array( 'decorator1' ) |
||
136 | * |
||
137 | * This would add the decorator named "decorator1" defined by |
||
138 | * "\Aimeos\Admin\JQAdm\Common\Decorator\Decorator1" only to the JQAdm client. |
||
139 | * |
||
140 | * @param array List of decorator names |
||
141 | * @since 2023.01 |
||
142 | * @category Developer |
||
143 | * @see admin/jqadm/common/decorators/default |
||
144 | * @see admin/jqadm/order/transaction/decorators/excludes |
||
145 | * @see admin/jqadm/order/transaction/decorators/local |
||
146 | */ |
||
147 | |||
148 | /** admin/jqadm/order/transaction/decorators/local |
||
149 | * Adds a list of local decorators only to the order JQAdm client |
||
150 | * |
||
151 | * Decorators extend the functionality of a class by adding new aspects |
||
152 | * (e.g. log what is currently done), executing the methods of the underlying |
||
153 | * class only in certain conditions (e.g. only for logged in users) or |
||
154 | * modify what is returned to the caller. |
||
155 | * |
||
156 | * This option allows you to wrap local decorators |
||
157 | * ("\Aimeos\Admin\JQAdm\Order\Decorator\*") around the JQAdm client. |
||
158 | * |
||
159 | * admin/jqadm/order/transaction/decorators/local = array( 'decorator2' ) |
||
160 | * |
||
161 | * This would add the decorator named "decorator2" defined by |
||
162 | * "\Aimeos\Admin\JQAdm\Order\Decorator\Decorator2" only to the JQAdm client. |
||
163 | * |
||
164 | * @param array List of decorator names |
||
165 | * @since 2023.01 |
||
166 | * @category Developer |
||
167 | * @see admin/jqadm/common/decorators/default |
||
168 | * @see admin/jqadm/order/transaction/decorators/excludes |
||
169 | * @see admin/jqadm/order/transaction/decorators/global |
||
170 | */ |
||
171 | return $this->createSubClient( 'order/transaction/' . $type, $name ); |
||
172 | } |
||
293 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.