@@ -57,10 +57,10 @@ public function getContentTag(): int
57
57
58
58
/**
59
59
* @param int $contentTagType
60
- * @return ListTag
60
+ * @return $this
61
61
* @throws Exception
62
62
*/
63
- public function setContentTag (int $ contentTagType ): ListTag
63
+ public function setContentTag (int $ contentTagType ): static
64
64
{
65
65
if ($ this ->isRaw ()) {
66
66
throw new Exception ("Raw list tags cannot be modified " );
@@ -83,7 +83,7 @@ public function setContentTag(int $contentTagType): ListTag
83
83
protected function readValues (Reader $ reader , int $ length ): array
84
84
{
85
85
$ values = [];
86
- /** @var Tag $tagClass */
86
+ /** @var class-string< Tag>|null $tagClass */
87
87
$ tagClass = Tag::getTagClass ($ this ->contentTagType );
88
88
if (is_null ($ tagClass )) {
89
89
throw new Exception ("Unknown ListTag content type " . $ this ->contentTagType );
@@ -153,7 +153,7 @@ protected static function readValueTagsRaw(Reader $reader, TagOptions $options,
153
153
{
154
154
$ valueData = "" ;
155
155
156
- /** @var Tag $tagClass */
156
+ /** @var class-string< Tag>|null $tagClass */
157
157
$ tagClass = Tag::getTagClass ($ contentType );
158
158
if (is_null ($ tagClass )) {
159
159
throw new Exception ("Unknown ListTag content type " . $ contentType );
@@ -198,7 +198,7 @@ public function offsetSet($offset, $value)
198
198
throw new Exception ("Raw list tags cannot be modified " );
199
199
}
200
200
201
- /** @var Tag $previousValue */
201
+ /** @var Tag|null $previousValue */
202
202
$ previousValue = $ this ->valueArray [$ offset ] ?? null ;
203
203
parent ::offsetSet ($ offset , $ value );
204
204
$ value ->setParentTag ($ this );
@@ -207,14 +207,15 @@ public function offsetSet($offset, $value)
207
207
208
208
/**
209
209
* @inheritDoc
210
+ * @throws Exception
210
211
*/
211
212
public function offsetUnset ($ offset )
212
213
{
213
214
if ($ this ->isRaw ()) {
214
215
throw new Exception ("Raw list tags cannot be modified " );
215
216
}
216
217
217
- /** @var Tag $previousValue */
218
+ /** @var Tag|null $previousValue */
218
219
$ previousValue = $ this ->valueArray [$ offset ] ?? null ;
219
220
$ previousValue ?->setParentTag(null );
220
221
parent ::offsetUnset ($ offset );
0 commit comments