We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| 1 | <?php |
||
| 25 | final class Contains implements Rule |
||
| 26 | { |
||
| 27 | /** |
||
| 28 | * @var mixed |
||
| 29 | */ |
||
| 30 | private $expectedValue; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @var bool |
||
| 34 | */ |
||
| 35 | private $identical; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Initializes the rule. |
||
| 39 | * |
||
| 40 | * @param mixed $expectedValue |
||
| 41 | * @param bool $identical |
||
| 42 | */ |
||
| 43 | 1 | public function __construct($expectedValue, bool $identical = false) |
|
| 48 | |||
| 49 | /** |
||
| 50 | * {@inheritdoc} |
||
| 51 | */ |
||
| 52 | 81 | public function validate($input): Result |
|
| 70 | |||
| 71 | /** |
||
| 72 | * Verifies if the input is equal to the expected value. |
||
| 73 | * |
||
| 74 | * @param string $input |
||
| 75 | * @param string $encoding |
||
| 76 | * |
||
| 77 | * @return bool |
||
| 78 | */ |
||
| 79 | 20 | private function isEqualToExpectedValue(string $input, string $encoding): bool |
|
| 83 | |||
| 84 | /** |
||
| 85 | * Verifies if the input is identical to the expected value. |
||
| 86 | * |
||
| 87 | * @param string $input |
||
| 88 | * @param string $encoding |
||
| 89 | * |
||
| 90 | * @return bool |
||
| 91 | */ |
||
| 92 | 24 | private function isIdenticalToExpectedValue(string $input, string $encoding): bool |
|
| 96 | } |
||
| 97 |