Add Arrays::containsEmptyStringsOnly() method

Returns information if given array contains an empty strings only
This commit is contained in:
Meritoo
2019-08-28 15:51:03 +02:00
parent 10992570ad
commit 891411e231
3 changed files with 85 additions and 0 deletions

View File

@@ -1633,6 +1633,15 @@ class Arrays
return is_array($value) && !empty($value);
}
public static function containsEmptyStringsOnly(array $array): bool
{
if (empty($array)) {
return false;
}
return '' === trim(implode('', $array));
}
/**
* Returns neighbour (next or previous element) for given element
*