| 1 | <?php | ||
| 16 | class HrefLang extends Extension | ||
| 17 | { | ||
| 18 | /** | ||
| 19 | * Name of Namescapce | ||
| 20 | */ | ||
| 21 | const NAMESPACE_NAME = 'xhtml'; | ||
| 22 | |||
| 23 | /** | ||
| 24 | * Namespace URL | ||
| 25 | */ | ||
| 26 | const NAMESPACE_URL = 'http://www.w3.org/1999/xhtml'; | ||
| 27 | |||
| 28 | /** | ||
| 29 | * Element name | ||
| 30 | */ | ||
| 31 | const ELEMENT_NAME = 'link'; | ||
| 32 | |||
| 33 | /** | ||
| 34 | * @dataType \Wszetko\Sitemap\Items\DataTypes\StringType | ||
| 35 | * @attribute href | ||
| 36 | * @attributeDataType \Wszetko\Sitemap\Items\DataTypes\URLType | ||
| 37 | * @var \Wszetko\Sitemap\Items\DataTypes\ArrayType | ||
| 38 | */ | ||
| 39 | protected $hrefLang; | ||
| 40 | |||
| 41 | /** | ||
| 42 | * @param string $hrefLang | ||
| 43 | * @param string $href | ||
| 44 | * | ||
| 45 | * @return self | ||
|  | |||
| 46 | * @throws \ReflectionException | ||
| 47 | */ | ||
| 48 | 3 | public function __construct(string $hrefLang, string $href) | |
| 63 | |||
| 64 | /** | ||
| 65 | * @return array | ||
| 66 | */ | ||
| 67 | 1 | public function toArray(): array | |
| 87 | } | ||
| 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.