@@ -90,12 +90,16 @@ abstract class AbstractElement implements Element
90
90
'dir ' => 'auto ' ,
91
91
];
92
92
93
+ /**
94
+ * @param array<string, string>|null $attributes
95
+ * @param array<int, \MadeByDenis\PhpMjmlRenderer\Node>|null $childNodes
96
+ */
93
97
public function __construct (?array $ attributes = [], string $ content = '' , ?array $ childNodes = [])
94
98
{
95
99
$ this ->attributes = $ this ->formatAttributes (
96
100
$ this ->defaultAttributes ,
97
101
$ this ->allowedAttributes ,
98
- $ attributes ,
102
+ $ attributes ?? [] ,
99
103
);
100
104
101
105
$ this ->content = $ content ;
@@ -351,10 +355,16 @@ protected function widthParser($width, $options = []): array
351
355
];
352
356
}
353
357
358
+ /**
359
+ * @param array<string, string> $defaultAttributes
360
+ * @param array<string, array<string, string>> $allowedAttributes
361
+ * @param array<string, string> $passedAttributes
362
+ * @return array<string, string>
363
+ */
354
364
private function formatAttributes (
355
365
array $ defaultAttributes ,
356
366
array $ allowedAttributes ,
357
- ? array $ passedAttributes = []
367
+ array $ passedAttributes = []
358
368
): array {
359
369
/*
360
370
* Check if the attributes are of the proper format based on the allowed attributes.
0 commit comments