We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| 1 | <?php |
||
| 17 | abstract class AbstractRelated implements Rule |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | private $reference; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var Rule|null |
||
| 26 | */ |
||
| 27 | private $rule; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @var bool |
||
| 31 | */ |
||
| 32 | private $mandatory = true; |
||
| 33 | |||
| 34 | 1 | public function __construct($reference, Rule $rule = null, bool $mandatory = true) |
|
| 40 | |||
| 41 | /** |
||
| 42 | * @param string $input |
||
| 43 | * |
||
| 44 | * @return bool |
||
| 45 | */ |
||
| 46 | abstract protected function hasReference($input, $reference): bool; |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @param string $input |
||
| 50 | * |
||
| 51 | * @return mixed |
||
| 52 | */ |
||
| 53 | abstract protected function getReferenceValue($input, $reference); |
||
| 54 | |||
| 55 | /** |
||
| 56 | * {@inheritdoc} |
||
| 57 | */ |
||
| 58 | 16 | public function validate($input): Result |
|
| 75 | } |
||
| 76 |