|
5 | 5 | namespace AtomGenerator; |
6 | 6 |
|
7 | 7 | use DOMDocument; |
| 8 | +use Exception; |
8 | 9 | use LibXMLError; |
9 | 10 | use SimpleXMLElement; |
10 | 11 | use Webmozart\Assert\Assert; |
11 | 12 |
|
12 | 13 | class Feed extends AbstractElement |
13 | 14 | { |
14 | 15 | /** @var Entry[] */ |
15 | | - protected $entries = []; |
| 16 | + protected array $entries = []; |
16 | 17 |
|
17 | | - /** @var bool */ |
18 | | - protected $prettify = false; |
| 18 | + protected bool $prettify = false; |
19 | 19 |
|
20 | | - /** @var null|string */ |
21 | | - protected $language; |
| 20 | + protected ?string $language = null; |
22 | 21 |
|
23 | | - /** @var null|string */ |
24 | | - protected $subtitle; |
| 22 | + protected ?string $subtitle = null; |
25 | 23 |
|
26 | | - /** @var null|string */ |
27 | | - protected $icon; |
| 24 | + protected ?string $icon = null; |
28 | 25 |
|
29 | | - /** @var null|string */ |
30 | | - protected $logo; |
| 26 | + protected ?string $logo = null; |
31 | 27 |
|
32 | | - /** @var null|string */ |
33 | | - protected $generator; |
| 28 | + protected ?string $generator = null; |
34 | 29 |
|
35 | | - /** @var null|string */ |
36 | | - protected $generatorVersion; |
| 30 | + protected ?string $generatorVersion = null; |
37 | 31 |
|
38 | | - /** @var null|string */ |
39 | | - protected $generatorUri; |
| 32 | + protected ?string $generatorUri = null; |
40 | 33 |
|
41 | 34 | /** |
42 | 35 | * @var array[] |
43 | 36 | * |
44 | 37 | * @phpstan-var array<array{ns: string, uri: string, name: string, value: string, attributes: string[]}> |
45 | 38 | */ |
46 | | - protected $customElements = []; |
| 39 | + protected array $customElements = []; |
47 | 40 |
|
48 | 41 | /** |
49 | 42 | * Feed constructor. |
@@ -174,6 +167,9 @@ public function addChildrenTo(SimpleXMLElement $parent): void |
174 | 167 | } |
175 | 168 | } |
176 | 169 |
|
| 170 | + /** |
| 171 | + * @throws Exception |
| 172 | + */ |
177 | 173 | public function getSimpleXML(): SimpleXMLElement |
178 | 174 | { |
179 | 175 | $attributes = []; |
|
0 commit comments