Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
4 / 4 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
ValidatorAbstract | |
100.00% |
4 / 4 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
getMessage | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getErrorCode | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
resetError | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | /** |
3 | * Jingga |
4 | * |
5 | * PHP Version 8.1 |
6 | * |
7 | * @package phpOMS\Validation |
8 | * @copyright Dennis Eichhorn |
9 | * @license OMS License 2.0 |
10 | * @version 1.0.0 |
11 | * @link https://jingga.app |
12 | */ |
13 | declare(strict_types=1); |
14 | |
15 | namespace phpOMS\Validation; |
16 | |
17 | /** |
18 | * Validator abstract. |
19 | * |
20 | * @package phpOMS\Validation |
21 | * @license OMS License 2.0 |
22 | * @link https://jingga.app |
23 | * @since 1.0.0 |
24 | */ |
25 | abstract class ValidatorAbstract implements ValidatorInterface |
26 | { |
27 | /** |
28 | * Error code. |
29 | * |
30 | * @var int |
31 | * @since 1.0.0 |
32 | */ |
33 | protected static int $error = 0; |
34 | |
35 | /** |
36 | * Message string. |
37 | * |
38 | * @var string |
39 | * @since 1.0.0 |
40 | */ |
41 | protected static string $msg = ''; |
42 | |
43 | /** |
44 | * {@inheritdoc} |
45 | */ |
46 | public static function getMessage() : string |
47 | { |
48 | return self::$msg; |
49 | } |
50 | |
51 | /** |
52 | * {@inheritdoc} |
53 | */ |
54 | public static function getErrorCode() : int |
55 | { |
56 | return self::$error; |
57 | } |
58 | |
59 | /** |
60 | * {@inheritdoc} |
61 | */ |
62 | public static function resetError() : void |
63 | { |
64 | self::$error = 0; |
65 | self::$msg = ''; |
66 | } |
67 | } |