| Total Complexity | 7 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Coverage | 66.67% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class NotTelegramImage implements Rule |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Create a new instance class. |
||
| 11 | * |
||
| 12 | * @param bool $mustBeString |
||
| 13 | * @param bool $canBeNull |
||
| 14 | * @return void |
||
| 15 | */ |
||
| 16 | 2 | public function __construct( |
|
| 20 | // |
||
| 21 | 2 | } |
|
| 22 | |||
| 23 | /** |
||
| 24 | * {@inheritDoc} |
||
| 25 | */ |
||
| 26 | 2 | public function passes($attribute, $value) |
|
| 27 | { |
||
| 28 | 2 | if (is_null($value) && $this->canBeNull) { |
|
| 29 | return true; |
||
| 30 | } |
||
| 31 | |||
| 32 | return |
||
| 33 | 2 | ($this->mustBeString ? is_string($value) : true) && |
|
| 34 | 2 | $value !== '%%%_IMAGE_%%%'; |
|
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * {@inheritDoc} |
||
| 39 | */ |
||
| 40 | public function message() |
||
| 43 | } |
||
| 44 | } |
||
| 45 |