Is::_()
Creates a virtual method.
Table of Contents
Description
Is::_(...$lot): mixed;This method adds a new static method dynamically so that it can be used later as if it were a native method.
Example
// This register will make method `Is::RGB()` available for use
Is::_('RGB', static function (mixed $value): bool {
if (!is_string($value)) {
return false;
}
if (0 !== strpos($value, 'rgb(')) {
return false;
}
return preg_match('/^rgb\(\s*([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\s*,\s*([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\s*,\s*([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\s*\)$/', $value);
});Is::IP()
Checks for valid IP address.
Is::JSON()
Checks for valid JSON string.
Is::URL()
Checks for valid URL address.
Is::_()
Creates a virtual method.
Is::__callStatic()
Calls the virtual method that has been created.
Is::email()
Checks for valid email address.
Is::file()
Checks if current input is a valid file path.
Is::folder()
Checks if current input is a valid folder path.
Is::path()
Checks if current input is a valid path.
Is::serial()
Checks for valid serialized string.
Is::toggle()
Checks for valid boolean.
Is::void()
Checks for empty string, array and object.