| Conditions | 3 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | public function validate() : bool |
||
| 15 | { |
||
| 16 | if(!$this->hasScheme() || URISchemes::isValidSchemeName((string)$this->getScheme())) { |
||
| 17 | return true; |
||
| 18 | } |
||
| 19 | |||
| 20 | $this->setScheme(''); |
||
| 21 | |||
| 22 | $this->parser->setError( |
||
| 23 | URLInfo::ERROR_INVALID_SCHEME, |
||
| 24 | t('The scheme %1$s is not supported for links.', $this->getScheme()) . ' ' . |
||
| 25 | t('Valid schemes are: %1$s.', implode(', ', URISchemes::getSchemeNames())) |
||
| 26 | ); |
||
| 27 | |||
| 28 | return false; |
||
| 29 | } |
||
| 31 |