We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| 1 | <?php |
||
| 21 | final class Result |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * @var bool |
||
| 25 | */ |
||
| 26 | private $isValid; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var mixed |
||
| 30 | */ |
||
| 31 | private $input; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @var Rule |
||
| 35 | */ |
||
| 36 | private $rule; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @var Result[] |
||
| 40 | */ |
||
| 41 | private $children; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @var array |
||
| 45 | */ |
||
| 46 | private $properties; |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Initializes the object. |
||
| 50 | * |
||
| 51 | * @param bool $isValid |
||
| 52 | * @param mixed $input |
||
| 53 | * @param Rule $rule |
||
| 54 | * @param array $properties |
||
| 55 | * @param Result $child |
||
| 56 | * @param Result ...$child2 |
||
| 57 | */ |
||
| 58 | 15 | public function __construct(bool $isValid, $input, Rule $rule, array $properties = [], Result ...$child) |
|
| 66 | |||
| 67 | /** |
||
| 68 | * Returns whether the result is valid or not. |
||
| 69 | * |
||
| 70 | * @return bool |
||
| 71 | */ |
||
| 72 | 3 | public function isValid(): bool |
|
| 76 | |||
| 77 | /** |
||
| 78 | * Returns the input that was used on the validation. |
||
| 79 | * |
||
| 80 | * @return mixed |
||
| 81 | */ |
||
| 82 | 3 | public function getInput() |
|
| 86 | |||
| 87 | /** |
||
| 88 | * Returns the rule that performed the validation. |
||
| 89 | * |
||
| 90 | * @return Rule |
||
| 91 | */ |
||
| 92 | 3 | public function getRule(): Rule |
|
| 96 | |||
| 97 | /** |
||
| 98 | * Returns the children of the result. |
||
| 99 | * |
||
| 100 | * @return Result[] |
||
| 101 | */ |
||
| 102 | 3 | public function getChildren(): array |
|
| 106 | |||
| 107 | /** |
||
| 108 | * Returns the properties of the result. |
||
| 109 | * |
||
| 110 | * @return array |
||
| 111 | */ |
||
| 112 | 8 | public function getProperties(): array |
|
| 116 | |||
| 117 | /** |
||
| 118 | * Creates a new object with the defined properties. |
||
| 119 | * |
||
| 120 | * @param array $properties |
||
| 121 | * |
||
| 122 | * @return Result |
||
| 123 | */ |
||
| 124 | 6 | public function mergeProperties(array $properties): Result |
|
| 131 | |||
| 132 | /** |
||
| 133 | * Creates a new object with the inverted validation. |
||
| 134 | * |
||
| 135 | * @return Result |
||
| 136 | */ |
||
| 137 | 6 | public function invert(): Result |
|
| 144 | } |
||
| 145 |