Skip to content

Commit

Permalink
perf: Simplify logic with dedicated helper function 'blank'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ar-Monta committed Mar 30, 2024
1 parent 23c5ace commit 717a585
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ function append_config(array $array)
*/
function blank($value)
{
if (is_null($value)) {
return true;
}

if (is_string($value)) {
return trim($value) === '';
}
Expand All @@ -55,10 +51,6 @@ function blank($value)
return false;
}

if ($value instanceof Countable) {
return count($value) === 0;
}

return empty($value);
}
}
Expand Down

0 comments on commit 717a585

Please sign in to comment.