1 | <?php |
||
14 | final class Validator |
||
15 | { |
||
16 | /** |
||
17 | * @var ObjectFacade |
||
18 | */ |
||
19 | private $facade; |
||
20 | |||
21 | /** |
||
22 | * Validator constructor. |
||
23 | * |
||
24 | * @param ObjectFacade $facade |
||
25 | */ |
||
26 | public function __construct(ObjectFacade $facade) |
||
30 | |||
31 | /** |
||
32 | * @param ObjectFacade $facade |
||
33 | * |
||
34 | * @return Validator |
||
35 | */ |
||
36 | public static function new(ObjectFacade $facade): self |
||
40 | |||
41 | /** |
||
42 | * @param ReflectionProperty $property |
||
43 | * |
||
44 | * @return bool |
||
45 | */ |
||
46 | public function isValidProperty(ReflectionProperty $property): bool |
||
50 | |||
51 | /** |
||
52 | * @param ReflectionMethod $method |
||
53 | * |
||
54 | * @return bool |
||
55 | */ |
||
56 | public function isValidMethod(ReflectionMethod $method): bool |
||
60 | |||
61 | /** |
||
62 | * @param ReflectionMethod $method |
||
63 | * @param $value |
||
64 | * |
||
65 | * @return bool |
||
66 | */ |
||
67 | public function isValidSetterMethod(ReflectionMethod $method, $value): bool |
||
87 | |||
88 | /** |
||
89 | * @param ReflectionParameter $parameter |
||
90 | * @param $value |
||
91 | * |
||
92 | * @return bool |
||
93 | */ |
||
94 | public function isValidParameterValue(ReflectionParameter $parameter, $value): bool |
||
98 | |||
99 | /** |
||
100 | * @param ReflectionMethod $method |
||
101 | * |
||
102 | * @return bool |
||
103 | */ |
||
104 | public function isValidGetterMethod(ReflectionMethod $method): bool |
||
114 | |||
115 | /** |
||
116 | * @param ReflectionMethod $method |
||
117 | * @param array ...$args |
||
118 | * |
||
119 | * @return bool |
||
120 | */ |
||
121 | public function areValidMethodArguments(ReflectionMethod $method, ...$args): bool |
||
133 | |||
134 | /** |
||
135 | * @param ReflectionMethod $method |
||
136 | * @param array ...$args |
||
137 | * |
||
138 | * @return bool |
||
139 | */ |
||
140 | private function validateMethodArguments(ReflectionMethod $method, ...$args): bool |
||
159 | } |