forked from Luracast/Restler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathValidation.php
42 lines (38 loc) · 888 Bytes
/
Validation.php
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
<?php
/**
* Class Validation provides api to check validation
*/
class Validation
{
/**
* Make sure string is converted properly to bool
* @param bool $value {@from query}
* @return bool
*/
function getBoolean($value)
{
return $value;
}
/**
* Make sure string is converted properly to bool
* @param bool $value {@from query}{@fix true}
* @return bool
*/
function getBoolFix($value)
{
return $value;
}
/**
* Validate with regex
*
* @param string $password {@pattern /^(?:[0-9]+[a-z]|[a-z]+[0-9])[a-z0-9]*$/i}
* {@message Strong password with at least
* one alpha and one numeric character is required}
*
* @return string
*/
function postPattern($password)
{
return $password;
}
}