Skip to content

Commit

Permalink
fix aa::notnull
Browse files Browse the repository at this point in the history
  • Loading branch information
qwenode committed Aug 11, 2023
1 parent d484085 commit 766e4c2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/AA.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ public static function anyAreNull(...$fields): bool
*/
public static function notNull($value): bool
{
if ($value === null) {
return false;
}
if (is_array($value)) {
if (count($value) == 0) {
return false;
Expand All @@ -103,6 +106,7 @@ public static function notNull($value): bool
if (is_string($value) && strlen(trim($value)) <= 0) {
return false;
}

if (empty($value) && $value !== '0') {
return false;
}
Expand Down

0 comments on commit 766e4c2

Please sign in to comment.