1 | <?php |
||
5 | class ArrayUtil |
||
6 | { |
||
7 | /** |
||
8 | * @param string $delimiter |
||
9 | * @param string $string |
||
10 | * |
||
11 | * @return array |
||
12 | */ |
||
13 | public static function trimExplode($delimiter, $string) |
||
26 | |||
27 | /** |
||
28 | * @param array $pieces |
||
29 | * @param string $conjunction |
||
30 | * @param string $glue |
||
31 | * |
||
32 | * @return mixed|string |
||
33 | */ |
||
34 | public static function humanLangImplode(array $pieces, $conjunction = 'and', $glue = ',') |
||
43 | } |
||
44 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.