@@ -47,7 +47,7 @@ public function writeContent(Writer $writer): static
47
47
if (in_array ($ value ->getName (), $ writtenNames )) {
48
48
throw new Exception ("Duplicate key ' " . $ value ->getName () . "' in compound tag " );
49
49
}
50
- $ value ->writeData ($ writer, true );
50
+ $ value ->writeData ($ writer );
51
51
}
52
52
(new EndTag ($ this ->options ))->writeData ($ writer );
53
53
return $ this ;
@@ -116,23 +116,23 @@ public function offsetSet($offset, $value): void
116
116
/**
117
117
* @inheritDoc
118
118
*/
119
- public function current ()
119
+ public function current (): bool | Tag
120
120
{
121
121
return current ($ this ->valueArray );
122
122
}
123
123
124
124
/**
125
125
* @inheritDoc
126
126
*/
127
- public function next ()
127
+ public function next (): void
128
128
{
129
129
next ($ this ->valueArray );
130
130
}
131
131
132
132
/**
133
133
* @inheritDoc
134
134
*/
135
- public function key ()
135
+ public function key (): ? string
136
136
{
137
137
return $ this ->current ()->getName ();
138
138
}
@@ -148,7 +148,7 @@ public function valid(): bool
148
148
/**
149
149
* @inheritDoc
150
150
*/
151
- public function rewind ()
151
+ public function rewind (): void
152
152
{
153
153
reset ($ this ->valueArray );
154
154
}
@@ -169,7 +169,7 @@ public function offsetExists($offset): bool
169
169
/**
170
170
* @inheritDoc
171
171
*/
172
- public function offsetGet ($ offset )
172
+ public function offsetGet ($ offset ): ? Tag
173
173
{
174
174
foreach ($ this ->valueArray as $ val ) {
175
175
if ($ val ->getName () === $ offset ) {
@@ -183,7 +183,7 @@ public function offsetGet($offset)
183
183
* @inheritDoc
184
184
* @throws Exception
185
185
*/
186
- public function offsetUnset ($ offset )
186
+ public function offsetUnset ($ offset ): void
187
187
{
188
188
if ($ this ->isRaw ()) {
189
189
throw new Exception ("Raw compound tags cannot be modified " );
@@ -214,14 +214,14 @@ protected function getValueString(): string
214
214
return strlen ($ this ->rawContent ) . " bytes " ;
215
215
}
216
216
return $ this ->count () . " entr " . ($ this ->count () === 1 ? "y " : "ies " ) . "\n{ \n" .
217
- $ this ->indent (implode (", \n" , array_map (" strval " , array_values ($ this ->valueArray )))) .
217
+ $ this ->indent (implode (", \n" , array_map (strval (...) , array_values ($ this ->valueArray )))) .
218
218
"\n} " ;
219
219
}
220
220
221
221
/**
222
222
* @inheritDoc
223
223
*/
224
- public function jsonSerialize ()
224
+ public function jsonSerialize (): array
225
225
{
226
226
$ data = [];
227
227
foreach ($ this ->valueArray as $ value ) {
0 commit comments