| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 47 | */ |
||
| 48 | 3 | public function __construct(string $hrefLang, string $href) |
|
| 49 | { |
||
| 50 | 3 | parent::__construct(); |
|
| 51 | |||
| 52 | 3 | $this->hrefLang |
|
| 53 | 3 | ->getBaseDataType() |
|
| 54 | 3 | ->setRequired(true) |
|
| 55 | 3 | ->setValueRegex("/^(?'hreflang'([a-z]{2}|(x))((-)([A-Za-z]{2}|[A-Z]([a-z]|[a-z]{3})|(default)))?)$/", 'hreflang'); |
|
| 56 | 3 | $this->hrefLang |
|
| 57 | 3 | ->getBaseDataType() |
|
| 58 | 3 | ->getAttribute('href') |
|
| 59 | 3 | ->setRequired(true); |
|
| 60 | |||
| 88 |
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.