| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 45 | 4 | public function isValid(AnnotatedInterface $model, $attribute) |
|
| 46 | { |
||
| 47 | 4 | $valid = filter_var($model->$attribute, FILTER_VALIDATE_URL); |
|
| 48 | 4 | if (!$valid) |
|
| 49 | { |
||
| 50 | 2 | $label = ManganMeta::create($model)->field($attribute)->label; |
|
| 51 | 2 | $this->addError('msgNotUrl', ['{attribute}' => $label]); |
|
| 52 | 2 | return false; |
|
| 53 | } |
||
| 54 | 2 | return true; |
|
| 55 | } |
||
| 56 | |||
| 58 |