ValidationUtils::isEmail()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Rico\Lib;
6
7
use Rico\Slib\ValidationUtils as StaticValidationUtils;
8
9
class ValidationUtils
10
{
11
    /**
12
     * Checks that $mixed value is an email.
13
     *
14
     * @param mixed $mixed
15
     *
16
     * @return bool
17
     */
18
    public function isEmail($mixed): bool
19
    {
20
        return StaticValidationUtils::isEmail($mixed);
21
    }
22
23
    /**
24
     * Checks that $mixed value is a hexadecimal value.
25
     *
26
     * @param mixed $mixed
27
     *
28
     * @return bool
29
     */
30
    public function isHexadecimal($mixed)
31
    {
32
        return StaticValidationUtils::isHexadecimal($mixed);
33
    }
34
35
    /**
36
     * Checks that $mixed value is an IP (v4 or v6).
37
     *
38
     * @param mixed $mixed
39
     *
40
     * @return bool
41
     */
42
    public function isIp($mixed): bool
43
    {
44
        return StaticValidationUtils::isIp($mixed);
45
    }
46
47
    /**
48
     * Checks that $mixed value is a decimal number (float or integer).
49
     *
50
     * @param mixed $mixed
51
     *
52
     * @return bool
53
     */
54
    public function isNumber($mixed): bool
55
    {
56
        return StaticValidationUtils::isNumber($mixed);
57
    }
58
59
    /**
60
     * Checks that $string value is a phone number.
61
     *
62
     * @param string $string
63
     *
64
     * @return bool
65
     */
66
    public function isPhoneNumber(string $string): bool
67
    {
68
        return StaticValidationUtils::isPhoneNumber($string);
69
    }
70
71
    /**
72
     * Checks that $mixed value is a positive integer (primary key).
73
     *
74
     * @param mixed $mixed
75
     *
76
     * @return bool
77
     */
78
    public function isPositiveInt($mixed): bool
79
    {
80
        return StaticValidationUtils::isPositiveInt($mixed);
81
    }
82
83
    /**
84
     * Checks that $mixed value is an URL.
85
     *
86
     * @param mixed $mixed
87
     *
88
     * @return bool
89
     */
90
    public function isURL($mixed): bool
91
    {
92
        return StaticValidationUtils::isURL($mixed);
93
    }
94
95
    /**
96
     * Checks that $mixed value is magnet URL.
97
     *
98
     * @param mixed $mixed
99
     *
100
     * @return bool
101
     */
102
    public function isURLMagnet($mixed): bool
103
    {
104
        return StaticValidationUtils::isURLMagnet($mixed);
105
    }
106
}
107