mirror of
https://github.com/wiosna-dev/common-library.git
synced 2026-03-13 01:51:50 +01:00
Add Arrays::containsEmptyStringsOnly() method
Returns information if given array contains an empty strings only
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user