1 | <?php |
||
10 | class CollectionUtils |
||
11 | { |
||
12 | /** |
||
13 | * @param array|Traversable $collection |
||
14 | * @param callable $collectFunction |
||
15 | * |
||
16 | * @return array |
||
17 | */ |
||
18 | public static function collect($collection, callable $collectFunction): array |
||
27 | |||
28 | /** |
||
29 | * @param array|Traversable $collection |
||
30 | * @param string $propertyName |
||
31 | * |
||
32 | * @return array |
||
33 | */ |
||
34 | public static function collectProperty($collection, string $propertyName): array |
||
43 | } |
||
44 |