Skip to content

Commit 30788bc

Browse files
committed
Added method validateBoolean
1 parent 5738d87 commit 30788bc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Validator.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
namespace Riculum\Validation;
33

4+
use JetBrains\PhpStorm\Pure;
45
use Riculum\Validation\exceptions\InvalidValidationException;
56
use Riculum\Validation\interfaces\ValidatorInterface;
67

@@ -340,6 +341,11 @@ public static function isValidEnum(?string $enum, array $enums, bool $required =
340341
}
341342
}
342343

344+
#[Pure] public static function isValidBoolean($boolean): bool
345+
{
346+
return self::validateBoolean($boolean);
347+
}
348+
343349
/**
344350
* @param string|null $city
345351
* @param int $minLength
@@ -1064,4 +1070,9 @@ public static function validateChar(?string $char, int $minLength = 1, int $maxL
10641070

10651071
return $char;
10661072
}
1073+
1074+
static function validateBoolean($boolean): bool
1075+
{
1076+
return is_bool($boolean);
1077+
}
10671078
}

0 commit comments

Comments
 (0)