Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
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 | |||
61 | 3 | $this->addHrefLang($hrefLang, $href); |
|
62 | 3 | } |
|
63 | |||
88 |
Adding a
@return
annotation 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.