-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathValidator.php
More file actions
executable file
·57 lines (45 loc) · 1.05 KB
/
Validator.php
File metadata and controls
executable file
·57 lines (45 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
namespace Utopia\Http;
abstract class Validator
{
public const TYPE_BOOLEAN = 'boolean';
public const TYPE_INTEGER = 'integer';
public const TYPE_FLOAT = 'double'; /* gettype() returns 'double' for historical reasons */
public const TYPE_STRING = 'string';
public const TYPE_ARRAY = 'array';
public const TYPE_OBJECT = 'object';
public const TYPE_MIXED = 'mixed';
/**
* Get Description
*
* Returns validator description
*
* @return string
*/
abstract public function getDescription(): string;
/**
* Is array
*
* Returns true if an array or false if not.
*
* @return bool
*/
abstract public function isArray(): bool;
/**
* Is valid
*
* Returns true if valid or false if not.
*
* @param mixed $value
* @return bool
*/
abstract public function isValid($value): bool;
/**
* Get Type
*
* Returns validator type.
*
* @return string
*/
abstract public function getType(): string;
}