We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
1 | <?php |
||
26 | final class KeyNested extends AbstractRelated |
||
27 | { |
||
28 | /** |
||
29 | * Initializes the rule. |
||
30 | * |
||
31 | * @param string $reference |
||
32 | * @param Rule $rule |
||
33 | * @param bool $mandatory |
||
34 | */ |
||
35 | public function __construct(string $reference, Rule $rule = null, bool $mandatory = true) |
||
39 | |||
40 | /** |
||
41 | * Verifies if the input has the reference. |
||
42 | * |
||
43 | * @param mixed $input |
||
44 | * @param string $reference |
||
45 | * |
||
46 | * @return bool |
||
47 | */ |
||
48 | 44 | protected function hasReference($input, $reference): bool |
|
58 | |||
59 | /** |
||
60 | * Get the value for the reference on the input. |
||
61 | * |
||
62 | * @param mixed $input |
||
63 | * @param string $reference |
||
64 | * |
||
65 | * @throws ComponentException When the value cannot be fetch |
||
66 | * |
||
67 | * @return mixed |
||
68 | */ |
||
69 | 44 | protected function getReferenceValue($input, $reference) |
|
84 | |||
85 | 36 | private function getValue(string $reference, $value, string $key) |
|
98 | |||
99 | 36 | private function getValueFromArray(string $reference, $array, string $key) |
|
109 | |||
110 | 8 | private function getValueFromObject(string $reference, $object, string $property) |
|
119 | } |
||
120 |