Skip to content

Commit

Permalink
Added method validateBoolean
Browse files Browse the repository at this point in the history
  • Loading branch information
riculum committed May 14, 2022
1 parent 5738d87 commit 30788bc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Validator.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
namespace Riculum\Validation;

use JetBrains\PhpStorm\Pure;
use Riculum\Validation\exceptions\InvalidValidationException;
use Riculum\Validation\interfaces\ValidatorInterface;

Expand Down Expand Up @@ -340,6 +341,11 @@ public static function isValidEnum(?string $enum, array $enums, bool $required =
}
}

#[Pure] public static function isValidBoolean($boolean): bool
{
return self::validateBoolean($boolean);
}

/**
* @param string|null $city
* @param int $minLength
Expand Down Expand Up @@ -1064,4 +1070,9 @@ public static function validateChar(?string $char, int $minLength = 1, int $maxL

return $char;
}

static function validateBoolean($boolean): bool
{
return is_bool($boolean);
}
}

0 comments on commit 30788bc

Please sign in to comment.