We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 14b11df commit c0335c5Copy full SHA for c0335c5
app/helpers/MetaFormats/Validators/VBool.php
@@ -6,19 +6,14 @@
6
use App\Helpers\MetaFormats\PhpTypes;
7
8
/**
9
- * Validates boolean values. Accepts bools, "true", "false", 0 and 1.
+ * Validates boolean values. Accepts only boolean true and false.
10
*/
11
class VBool
12
{
13
public const SWAGGER_TYPE = "boolean";
14
15
public function validate(mixed $value)
16
17
- // support stringified values as well as 0 and 1
18
- return MetaFormatHelper::checkType($value, PhpTypes::Bool)
19
- || $value == 0
20
- || $value == 1
21
- || $value == "true"
22
- || $value == "false";
+ return $value === true || $value === false;
23
}
24
0 commit comments