|
4 | 4 |
|
5 | 5 | use Facebook\WebDriver\Exception\NoSuchElementException; |
6 | 6 | use Facebook\WebDriver\Exception\TimeoutException; |
| 7 | +use Override; |
7 | 8 | use PrinsFrank\Enums\BackedEnum; |
8 | 9 | use PrinsFrank\Enums\Exception\InvalidArgumentException; |
9 | 10 | use PrinsFrank\Enums\Exception\NameNotFoundException; |
|
21 | 22 | * @implements Mapping<TDataSet> |
22 | 23 | */ |
23 | 24 | class EUMapping implements Mapping { |
| 25 | + #[Override] |
24 | 26 | public static function url(): string { |
25 | 27 | return 'https://european-union.europa.eu/principles-countries-history/eu-countries_en'; |
26 | 28 | } |
27 | 29 |
|
28 | 30 | /** @throws NoSuchElementException|TimeoutException */ |
| 31 | + #[Override] |
29 | 32 | public static function toDataSet(Client $client, Crawler $crawler): array { |
30 | 33 | $client->waitFor('//a[contains(@class, "wt-ecl-button")]'); |
31 | 34 | $crawler->filterXPath('//a[contains(@class, "wt-ecl-button")]')->click(); |
@@ -55,9 +58,10 @@ public static function toDataSet(Client $client, Crawler $crawler): array { |
55 | 58 | } |
56 | 59 |
|
57 | 60 | /** @throws NameNotFoundException|InvalidArgumentException */ |
| 61 | + #[Override] |
58 | 62 | public static function toEnumMapping(array $dataSet): array { |
59 | 63 | $EU = (new SpecFile(EU::class, KeySorting::class)) |
60 | | - ->addMethod($allAlpha2 = new EnumListMethod('allAlpha2', 'array', '/** @return list<CountryAlpha2> */')); |
| 64 | + ->addMethod($allAlpha2 = new EnumListMethod('allAlpha2', 'array', '/** @return list<CountryAlpha2> */' . PHP_EOL . ' #[Override]')); |
61 | 65 |
|
62 | 66 | foreach ($dataSet as $dataRow) { |
63 | 67 | $allAlpha2->addItem('CountryAlpha2::' . BackedEnum::fromName(CountryAlpha2::class, $dataRow->name)->name); |
|
0 commit comments