Complex classes like BaseArrayHelper often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use BaseArrayHelper, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
22 | class BaseArrayHelper |
||
23 | { |
||
24 | /** |
||
25 | * Converts an object or an array of objects into an array. |
||
26 | * @param object|array|string $object the object to be converted into an array |
||
27 | * @param array $properties a mapping from object class names to the properties that need to put into the resulting arrays. |
||
28 | * The properties specified for each class is an array of the following format: |
||
29 | * |
||
30 | * ```php |
||
31 | * [ |
||
32 | * 'app\models\Post' => [ |
||
33 | * 'id', |
||
34 | * 'title', |
||
35 | * // the key name in array result => property name |
||
36 | * 'createTime' => 'created_at', |
||
37 | * // the key name in array result => anonymous function |
||
38 | * 'length' => function ($post) { |
||
39 | * return strlen($post->content); |
||
40 | * }, |
||
41 | * ], |
||
42 | * ] |
||
43 | * ``` |
||
44 | * |
||
45 | * The result of `ArrayHelper::toArray($post, $properties)` could be like the following: |
||
46 | * |
||
47 | * ```php |
||
48 | * [ |
||
49 | * 'id' => 123, |
||
50 | * 'title' => 'test', |
||
51 | * 'createTime' => '2013-01-01 12:00AM', |
||
52 | * 'length' => 301, |
||
53 | * ] |
||
54 | * ``` |
||
55 | * |
||
56 | * @param bool $recursive whether to recursively converts properties which are objects into arrays. |
||
57 | * @return array the array representation of the object |
||
58 | */ |
||
59 | 8 | public static function toArray($object, $properties = [], $recursive = true) |
|
101 | |||
102 | /** |
||
103 | * Merges two or more arrays into one recursively. |
||
104 | * If each array has an element with the same string key value, the latter |
||
105 | * will overwrite the former (different from array_merge_recursive). |
||
106 | * Recursive merging will be conducted if both arrays have an element of array |
||
107 | * type and are having the same key. |
||
108 | * For integer-keyed elements, the elements from the latter array will |
||
109 | * be appended to the former array. |
||
110 | * You can use [[UnsetArrayValue]] object to unset value from previous array or |
||
111 | * [[ReplaceArrayValue]] to force replace former value instead of recursive merging. |
||
112 | * @param array $a array to be merged to |
||
113 | * @param array $b array to be merged from. You can specify additional |
||
114 | * arrays via third argument, fourth argument etc. |
||
115 | * @return array the merged array (the original arrays are not changed.) |
||
116 | */ |
||
117 | 2077 | public static function merge($a, $b) |
|
144 | |||
145 | /** |
||
146 | * Retrieves the value of an array element or object property with the given key or property name. |
||
147 | * If the key does not exist in the array or object, the default value will be returned instead. |
||
148 | * |
||
149 | * The key may be specified in a dot format to retrieve the value of a sub-array or the property |
||
150 | * of an embedded object. In particular, if the key is `x.y.z`, then the returned value would |
||
151 | * be `$array['x']['y']['z']` or `$array->x->y->z` (if `$array` is an object). If `$array['x']` |
||
152 | * or `$array->x` is neither an array nor an object, the default value will be returned. |
||
153 | * Note that if the array already has an element `x.y.z`, then its value will be returned |
||
154 | * instead of going through the sub-arrays. So it is better to be done specifying an array of key names |
||
155 | * like `['x', 'y', 'z']`. |
||
156 | * |
||
157 | * Below are some usage examples, |
||
158 | * |
||
159 | * ```php |
||
160 | * // working with array |
||
161 | * $username = \yii\helpers\ArrayHelper::getValue($_POST, 'username'); |
||
162 | * // working with object |
||
163 | * $username = \yii\helpers\ArrayHelper::getValue($user, 'username'); |
||
164 | * // working with anonymous function |
||
165 | * $fullName = \yii\helpers\ArrayHelper::getValue($user, function ($user, $defaultValue) { |
||
166 | * return $user->firstName . ' ' . $user->lastName; |
||
167 | * }); |
||
168 | * // using dot format to retrieve the property of embedded object |
||
169 | * $street = \yii\helpers\ArrayHelper::getValue($users, 'address.street'); |
||
170 | * // using an array of keys to retrieve the value |
||
171 | * $value = \yii\helpers\ArrayHelper::getValue($versions, ['1.0', 'date']); |
||
172 | * ``` |
||
173 | * |
||
174 | * @param array|object $array array or object to extract value from |
||
175 | * @param string|\Closure|array $key key name of the array element, an array of keys or property name of the object, |
||
176 | * or an anonymous function returning the value. The anonymous function signature should be: |
||
177 | * `function($array, $defaultValue)`. |
||
178 | * The possibility to pass an array of keys is available since version 2.0.4. |
||
179 | * @param mixed $default the default value to be returned if the specified array key does not exist. Not used when |
||
180 | * getting value from an object. |
||
181 | * @return mixed the value of the element if found, default value otherwise |
||
182 | */ |
||
183 | public static function getValue($array, $key, $default = null) |
||
216 | |||
217 | /** |
||
218 | * Removes an item from an array and returns the value. If the key does not exist in the array, the default value |
||
219 | * will be returned instead. |
||
220 | * |
||
221 | * Usage examples, |
||
222 | * |
||
223 | * ```php |
||
224 | * // $array = ['type' => 'A', 'options' => [1, 2]]; |
||
225 | * // working with array |
||
226 | * $type = \yii\helpers\ArrayHelper::remove($array, 'type'); |
||
227 | * // $array content |
||
228 | * // $array = ['options' => [1, 2]]; |
||
229 | * ``` |
||
230 | * |
||
231 | * @param array $array the array to extract value from |
||
232 | * @param string $key key name of the array element |
||
233 | * @param mixed $default the default value to be returned if the specified key does not exist |
||
234 | * @return mixed|null the value of the element if found, default value otherwise |
||
235 | */ |
||
236 | public static function remove(&$array, $key, $default = null) |
||
247 | |||
248 | /** |
||
249 | * Removes items with matching values from the array and returns the removed items. |
||
250 | * |
||
251 | * Example, |
||
252 | * |
||
253 | * ```php |
||
254 | * $array = ['Bob' => 'Dylan', 'Michael' => 'Jackson', 'Mick' => 'Jagger', 'Janet' => 'Jackson']; |
||
255 | * $removed = \yii\helpers\ArrayHelper::removeValue($array, 'Jackson'); |
||
256 | * // result: |
||
257 | * // $array = ['Bob' => 'Dylan', 'Mick' => 'Jagger']; |
||
258 | * // $removed = ['Michael' => 'Jackson', 'Janet' => 'Jackson']; |
||
259 | * ``` |
||
260 | * |
||
261 | * @param array $array the array where to look the value from |
||
262 | * @param string $value the value to remove from the array |
||
263 | * @return array the items that were removed from the array |
||
264 | * @since 2.0.11 |
||
265 | */ |
||
266 | public static function removeValue(&$array, $value) |
||
279 | |||
280 | /** |
||
281 | * Indexes and/or groups the array according to a specified key. |
||
282 | * The input should be either multidimensional array or an array of objects. |
||
283 | * |
||
284 | * The $key can be either a key name of the sub-array, a property name of object, or an anonymous |
||
285 | * function that must return the value that will be used as a key. |
||
286 | * |
||
287 | * $groups is an array of keys, that will be used to group the input array into one or more sub-arrays based |
||
288 | * on keys specified. |
||
289 | * |
||
290 | * If the `$key` is specified as `null` or a value of an element corresponding to the key is `null` in addition |
||
291 | * to `$groups` not specified then the element is discarded. |
||
292 | * |
||
293 | * For example: |
||
294 | * |
||
295 | * ```php |
||
296 | * $array = [ |
||
297 | * ['id' => '123', 'data' => 'abc', 'device' => 'laptop'], |
||
298 | * ['id' => '345', 'data' => 'def', 'device' => 'tablet'], |
||
299 | * ['id' => '345', 'data' => 'hgi', 'device' => 'smartphone'], |
||
300 | * ]; |
||
301 | * $result = ArrayHelper::index($array, 'id'); |
||
302 | * ``` |
||
303 | * |
||
304 | * The result will be an associative array, where the key is the value of `id` attribute |
||
305 | * |
||
306 | * ```php |
||
307 | * [ |
||
308 | * '123' => ['id' => '123', 'data' => 'abc', 'device' => 'laptop'], |
||
309 | * '345' => ['id' => '345', 'data' => 'hgi', 'device' => 'smartphone'] |
||
310 | * // The second element of an original array is overwritten by the last element because of the same id |
||
311 | * ] |
||
312 | * ``` |
||
313 | * |
||
314 | * An anonymous function can be used in the grouping array as well. |
||
315 | * |
||
316 | * ```php |
||
317 | * $result = ArrayHelper::index($array, function ($element) { |
||
318 | * return $element['id']; |
||
319 | * }); |
||
320 | * ``` |
||
321 | * |
||
322 | * Passing `id` as a third argument will group `$array` by `id`: |
||
323 | * |
||
324 | * ```php |
||
325 | * $result = ArrayHelper::index($array, null, 'id'); |
||
326 | * ``` |
||
327 | * |
||
328 | * The result will be a multidimensional array grouped by `id` on the first level, by `device` on the second level |
||
329 | * and indexed by `data` on the third level: |
||
330 | * |
||
331 | * ```php |
||
332 | * [ |
||
333 | * '123' => [ |
||
334 | * ['id' => '123', 'data' => 'abc', 'device' => 'laptop'] |
||
335 | * ], |
||
336 | * '345' => [ // all elements with this index are present in the result array |
||
337 | * ['id' => '345', 'data' => 'def', 'device' => 'tablet'], |
||
338 | * ['id' => '345', 'data' => 'hgi', 'device' => 'smartphone'], |
||
339 | * ] |
||
340 | * ] |
||
341 | * ``` |
||
342 | * |
||
343 | * The anonymous function can be used in the array of grouping keys as well: |
||
344 | * |
||
345 | * ```php |
||
346 | * $result = ArrayHelper::index($array, 'data', [function ($element) { |
||
347 | * return $element['id']; |
||
348 | * }, 'device']); |
||
349 | 3 | * ``` |
|
350 | * |
||
351 | 3 | * The result will be a multidimensional array grouped by `id` on the first level, by the `device` on the second one |
|
352 | 3 | * and indexed by the `data` on the third level: |
|
353 | * |
||
354 | 3 | * ```php |
|
355 | 3 | * [ |
|
356 | * '123' => [ |
||
357 | 3 | * 'laptop' => [ |
|
358 | 1 | * 'abc' => ['id' => '123', 'data' => 'abc', 'device' => 'laptop'] |
|
359 | 1 | * ] |
|
360 | 1 | * ], |
|
361 | 1 | * '345' => [ |
|
362 | 1 | * 'tablet' => [ |
|
363 | 3 | * 'def' => ['id' => '345', 'data' => 'def', 'device' => 'tablet'] |
|
364 | * ], |
||
365 | 3 | * 'smartphone' => [ |
|
366 | 2 | * 'hgi' => ['id' => '345', 'data' => 'hgi', 'device' => 'smartphone'] |
|
367 | 1 | * ] |
|
368 | 1 | * ] |
|
369 | 2 | * ] |
|
370 | 3 | * ``` |
|
371 | 3 | * |
|
372 | 3 | * @param array $array the array that needs to be indexed or grouped |
|
373 | 1 | * @param string|\Closure|null $key the column name or anonymous function which result will be used to index the array |
|
374 | 1 | * @param string|string[]|\Closure[]|null $groups the array of keys, that will be used to group the input array |
|
375 | 3 | * by one or more keys. If the $key attribute or its value for the particular element is null and $groups is not |
|
376 | 3 | * defined, the array element will be discarded. Otherwise, if $groups is specified, array element will be added |
|
377 | * to the result array without any key. This parameter is available since version 2.0.8. |
||
378 | 3 | * @return array the indexed and/or grouped array |
|
379 | 3 | */ |
|
380 | public static function index($array, $key, $groups = []) |
||
414 | 7 | ||
415 | 7 | /** |
|
416 | 7 | * Returns the values of a specified column in an array. |
|
417 | 7 | * The input array should be multidimensional or an array of objects. |
|
418 | 1 | * |
|
419 | 1 | * For example, |
|
420 | 1 | * |
|
421 | * ```php |
||
422 | * $array = [ |
||
423 | 7 | * ['id' => '123', 'data' => 'abc'], |
|
424 | * ['id' => '345', 'data' => 'def'], |
||
425 | * ]; |
||
426 | * $result = ArrayHelper::getColumn($array, 'id'); |
||
427 | * // the result is: ['123', '345'] |
||
428 | * |
||
429 | * // using anonymous function |
||
430 | * $result = ArrayHelper::getColumn($array, function ($element) { |
||
431 | * return $element['id']; |
||
432 | * }); |
||
433 | * ``` |
||
434 | * |
||
435 | * @param array $array |
||
436 | * @param string|\Closure $name |
||
437 | * @param bool $keepKeys whether to maintain the array keys. If false, the resulting array |
||
438 | * will be re-indexed with integers. |
||
439 | * @return array the list of column values |
||
440 | */ |
||
441 | public static function getColumn($array, $name, $keepKeys = true) |
||
456 | |||
457 | /** |
||
458 | * Builds a map (key-value pairs) from a multidimensional array or an array of objects. |
||
459 | * The `$from` and `$to` parameters specify the key names or property names to set up the map. |
||
460 | * Optionally, one can further group the map according to a grouping field `$group`. |
||
461 | * |
||
462 | * For example, |
||
463 | * |
||
464 | * ```php |
||
465 | * $array = [ |
||
466 | * ['id' => '123', 'name' => 'aaa', 'class' => 'x'], |
||
467 | 22 | * ['id' => '124', 'name' => 'bbb', 'class' => 'x'], |
|
468 | * ['id' => '345', 'name' => 'ccc', 'class' => 'y'], |
||
469 | 22 | * ]; |
|
470 | 22 | * |
|
471 | 21 | * $result = ArrayHelper::map($array, 'id', 'name'); |
|
472 | 21 | * // the result is: |
|
473 | 21 | * // [ |
|
474 | 1 | * // '123' => 'aaa', |
|
475 | 1 | * // '124' => 'bbb', |
|
476 | 21 | * // '345' => 'ccc', |
|
477 | * // ] |
||
478 | 22 | * |
|
479 | * $result = ArrayHelper::map($array, 'id', 'name', 'class'); |
||
480 | 22 | * // the result is: |
|
481 | * // [ |
||
482 | * // 'x' => [ |
||
483 | * // '123' => 'aaa', |
||
484 | * // '124' => 'bbb', |
||
485 | * // ], |
||
486 | * // 'y' => [ |
||
487 | * // '345' => 'ccc', |
||
488 | * // ], |
||
489 | * // ] |
||
490 | * ``` |
||
491 | * |
||
492 | 8 | * @param array $array |
|
493 | * @param string|\Closure $from |
||
494 | 8 | * @param string|\Closure $to |
|
495 | * @param string|\Closure $group |
||
496 | * @return array |
||
497 | 8 | */ |
|
498 | public static function map($array, $from, $to, $group = null) |
||
513 | |||
514 | /** |
||
515 | * Checks if the given array contains the specified key. |
||
516 | * This method enhances the `array_key_exists()` function by supporting case-insensitive |
||
517 | * key comparison. |
||
518 | * @param string $key the key to check |
||
519 | * @param array $array the array with keys to check |
||
520 | * @param bool $caseSensitive whether the key comparison should be case-sensitive |
||
521 | * @return bool whether the array contains the specified key |
||
522 | */ |
||
523 | public static function keyExists($key, $array, $caseSensitive = true) |
||
539 | 6 | ||
540 | /** |
||
541 | * Sorts an array of objects or arrays (with the same structure) by one or several keys. |
||
542 | 6 | * @param array $array the array to be sorted. The array will be modified after calling this method. |
|
543 | 6 | * @param string|\Closure|array $key the key(s) to be sorted by. This refers to a key name of the sub-array |
|
544 | 6 | * elements, a property name of the objects, or an anonymous function returning the values for comparison |
|
545 | 6 | * purpose. The anonymous function signature should be: `function($item)`. |
|
546 | 6 | * To sort by multiple keys, provide an array of keys here. |
|
547 | 6 | * @param int|array $direction the sorting direction. It can be either `SORT_ASC` or `SORT_DESC`. |
|
548 | 6 | * When sorting by multiple keys with different sorting directions, use an array of sorting directions. |
|
549 | * @param int|array $sortFlag the PHP sort flag. Valid values include |
||
550 | * `SORT_REGULAR`, `SORT_NUMERIC`, `SORT_STRING`, `SORT_LOCALE_STRING`, `SORT_NATURAL` and `SORT_FLAG_CASE`. |
||
551 | * Please refer to [PHP manual](http://php.net/manual/en/function.sort.php) |
||
552 | 6 | * for more details. When sorting by multiple keys with different sort flags, use an array of sort flags. |
|
553 | 6 | * @throws InvalidParamException if the $direction or $sortFlag parameters do not have |
|
554 | 6 | * correct number of elements as that of $key. |
|
555 | */ |
||
556 | 6 | public static function multisort(&$array, $key, $direction = SORT_ASC, $sortFlag = SORT_REGULAR) |
|
590 | 1 | ||
591 | /** |
||
592 | 1 | * Encodes special characters in an array of strings into HTML entities. |
|
593 | * Only array values will be encoded by default. |
||
594 | * If a value is an array, this method will also encode it recursively. |
||
595 | * Only string values will be encoded. |
||
596 | * @param array $data data to be encoded |
||
597 | * @param bool $valuesOnly whether to encode array values only. If false, |
||
598 | * both the array keys and array values will be encoded. |
||
599 | * @param string $charset the charset that the data is using. If not set, |
||
600 | * [[\yii\base\Application::charset]] will be used. |
||
601 | * @return array the encoded data |
||
602 | * @see http://www.php.net/manual/en/function.htmlspecialchars.php |
||
603 | */ |
||
604 | public static function htmlEncode($data, $valuesOnly = true, $charset = null) |
||
625 | |||
626 | /** |
||
627 | * Decodes HTML entities into the corresponding characters in an array of strings. |
||
628 | * Only array values will be decoded by default. |
||
629 | * If a value is an array, this method will also decode it recursively. |
||
630 | * Only string values will be decoded. |
||
631 | * @param array $data data to be decoded |
||
632 | * @param bool $valuesOnly whether to decode array values only. If false, |
||
633 | * both the array keys and array values will be decoded. |
||
634 | * @return array the decoded data |
||
635 | * @see http://www.php.net/manual/en/function.htmlspecialchars-decode.php |
||
636 | */ |
||
637 | public static function htmlDecode($data, $valuesOnly = true) |
||
655 | |||
656 | /** |
||
657 | * Returns a value indicating whether the given array is an associative array. |
||
658 | * |
||
659 | * An array is associative if all its keys are strings. If `$allStrings` is false, |
||
660 | * then an array will be treated as associative if at least one of its keys is a string. |
||
661 | * |
||
662 | * Note that an empty array will NOT be considered associative. |
||
663 | * |
||
664 | * @param array $array the array being checked |
||
665 | * @param bool $allStrings whether the array keys must be all strings in order for |
||
666 | * the array to be treated as associative. |
||
667 | * @return bool whether the array is associative |
||
668 | */ |
||
669 | public static function isAssociative($array, $allStrings = true) |
||
691 | 1 | ||
692 | 1 | /** |
|
693 | * Returns a value indicating whether the given array is an indexed array. |
||
694 | * |
||
695 | * An array is indexed if all its keys are integers. If `$consecutive` is true, |
||
696 | * then the array keys must be a consecutive sequence starting from 0. |
||
697 | * |
||
698 | * Note that an empty array will be considered indexed. |
||
699 | * |
||
700 | * @param array $array the array being checked |
||
701 | * @param bool $consecutive whether the array keys must be a consecutive sequence |
||
702 | * in order for the array to be treated as indexed. |
||
703 | * @return bool whether the array is associative |
||
704 | */ |
||
705 | public static function isIndexed($array, $consecutive = false) |
||
726 | |||
727 | /** |
||
728 | * Check whether an array or [[\Traversable]] contains an element. |
||
729 | * |
||
730 | * This method does the same as the PHP function [in_array()](http://php.net/manual/en/function.in-array.php) |
||
731 | * but additionally works for objects that implement the [[\Traversable]] interface. |
||
732 | * @param mixed $needle The value to look for. |
||
733 | * @param array|\Traversable $haystack The set of values to search. |
||
734 | * @param bool $strict Whether to enable strict (`===`) comparison. |
||
735 | * @return bool `true` if `$needle` was found in `$haystack`, `false` otherwise. |
||
736 | 382 | * @throws InvalidParamException if `$haystack` is neither traversable nor an array. |
|
737 | * @see http://php.net/manual/en/function.in-array.php |
||
738 | 382 | * @since 2.0.7 |
|
739 | */ |
||
740 | public static function isIn($needle, $haystack, $strict = false) |
||
756 | 5 | ||
757 | 4 | /** |
|
758 | 3 | * Checks whether a variable is an array or [[\Traversable]]. |
|
759 | * |
||
760 | 4 | * This method does the same as the PHP function [is_array()](http://php.net/manual/en/function.is-array.php) |
|
761 | 4 | * but additionally works on objects that implement the [[\Traversable]] interface. |
|
762 | * @param mixed $var The variable being evaluated. |
||
763 | 1 | * @return bool whether $var is array-like |
|
764 | * @see http://php.net/manual/en/function.is_array.php |
||
765 | * @since 2.0.8 |
||
766 | */ |
||
767 | public static function isTraversable($var) |
||
771 | |||
772 | /** |
||
773 | * Checks whether an array or [[\Traversable]] is a subset of another array or [[\Traversable]]. |
||
774 | * |
||
775 | * This method will return `true`, if all elements of `$needles` are contained in |
||
776 | * `$haystack`. If at least one element is missing, `false` will be returned. |
||
777 | * @param array|\Traversable $needles The values that must **all** be in `$haystack`. |
||
778 | * @param array|\Traversable $haystack The set of value to search. |
||
779 | * @param bool $strict Whether to enable strict (`===`) comparison. |
||
780 | * @throws InvalidParamException if `$haystack` or `$needles` is neither traversable nor an array. |
||
781 | * @return bool `true` if `$needles` is a subset of `$haystack`, `false` otherwise. |
||
782 | * @since 2.0.7 |
||
783 | */ |
||
784 | public static function isSubset($needles, $haystack, $strict = false) |
||
797 | |||
798 | /** |
||
799 | * Filters array according to rules specified. |
||
800 | * |
||
801 | * For example: |
||
802 | * |
||
803 | * ```php |
||
804 | * $array = [ |
||
805 | * 'A' => [1, 2], |
||
806 | * 'B' => [ |
||
807 | * 'C' => 1, |
||
808 | * 'D' => 2, |
||
809 | * ], |
||
810 | * 'E' => 1, |
||
811 | 24 | * ]; |
|
812 | * |
||
813 | 24 | * $result = \yii\helpers\ArrayHelper::filter($array, ['A']); |
|
814 | 24 | * // $result will be: |
|
815 | * // [ |
||
816 | 24 | * // 'A' => [1, 2], |
|
817 | 5 | * // ] |
|
818 | 5 | * |
|
819 | 5 | * $result = \yii\helpers\ArrayHelper::filter($array, ['A', 'B.C']); |
|
820 | * // $result will be: |
||
821 | 5 | * // [ |
|
822 | 2 | * // 'A' => [1, 2], |
|
823 | 2 | * // 'B' => ['C' => 1], |
|
824 | 2 | * // ] |
|
825 | * |
||
826 | 2 | * $result = \yii\helpers\ArrayHelper::filter($array, ['B', '!B.C']); |
|
827 | * // $result will be: |
||
828 | * // [ |
||
829 | 5 | * // 'B' => ['D' => 2], |
|
830 | 5 | * // ] |
|
831 | * ``` |
||
832 | 5 | * |
|
833 | 5 | * @param array $array Source array |
|
834 | 5 | * @param array $filters Rules that define array keys which should be left or removed from results. |
|
835 | * Each rule is: |
||
836 | 2 | * - `var` - `$array['var']` will be left in result. |
|
837 | 1 | * - `var.key` = only `$array['var']['key'] will be left in result. |
|
838 | * - `!var.key` = `$array['var']['key'] will be removed from result. |
||
839 | 2 | * @return array Filtered array |
|
840 | 2 | * @since 2.0.9 |
|
841 | 2 | */ |
|
842 | 2 | public static function filter($array, $filters) |
|
885 | } |
||
886 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.