Validator::isBoolean()

Assert that each specified variable is a boolean.


Return

(DotenvValidator)


Source

File: vendor/vlucas/phpdotenv/src/Validator.php

    public function isBoolean()
    {
        return $this->assertCallback(
            function ($value) {
                if ($value === null) {
                    return true;
                }

                if ($value === '') {
                    return false;
                }

                return filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE) !== null;
            },
            'is not a boolean'
        );
    }