@@ -57,10 +57,10 @@ public function getContentTag(): int
5757
5858 /**
5959 * @param int $contentTagType
60- * @return ListTag
60+ * @return $this
6161 * @throws Exception
6262 */
63- public function setContentTag (int $ contentTagType ): ListTag
63+ public function setContentTag (int $ contentTagType ): static
6464 {
6565 if ($ this ->isRaw ()) {
6666 throw new Exception ("Raw list tags cannot be modified " );
@@ -83,7 +83,7 @@ public function setContentTag(int $contentTagType): ListTag
8383 protected function readValues (Reader $ reader , int $ length ): array
8484 {
8585 $ values = [];
86- /** @var Tag $tagClass */
86+ /** @var class-string< Tag>|null $tagClass */
8787 $ tagClass = Tag::getTagClass ($ this ->contentTagType );
8888 if (is_null ($ tagClass )) {
8989 throw new Exception ("Unknown ListTag content type " . $ this ->contentTagType );
@@ -153,7 +153,7 @@ protected static function readValueTagsRaw(Reader $reader, TagOptions $options,
153153 {
154154 $ valueData = "" ;
155155
156- /** @var Tag $tagClass */
156+ /** @var class-string< Tag>|null $tagClass */
157157 $ tagClass = Tag::getTagClass ($ contentType );
158158 if (is_null ($ tagClass )) {
159159 throw new Exception ("Unknown ListTag content type " . $ contentType );
@@ -198,7 +198,7 @@ public function offsetSet($offset, $value)
198198 throw new Exception ("Raw list tags cannot be modified " );
199199 }
200200
201- /** @var Tag $previousValue */
201+ /** @var Tag|null $previousValue */
202202 $ previousValue = $ this ->valueArray [$ offset ] ?? null ;
203203 parent ::offsetSet ($ offset , $ value );
204204 $ value ->setParentTag ($ this );
@@ -207,14 +207,15 @@ public function offsetSet($offset, $value)
207207
208208 /**
209209 * @inheritDoc
210+ * @throws Exception
210211 */
211212 public function offsetUnset ($ offset )
212213 {
213214 if ($ this ->isRaw ()) {
214215 throw new Exception ("Raw list tags cannot be modified " );
215216 }
216217
217- /** @var Tag $previousValue */
218+ /** @var Tag|null $previousValue */
218219 $ previousValue = $ this ->valueArray [$ offset ] ?? null ;
219220 $ previousValue ?->setParentTag(null );
220221 parent ::offsetUnset ($ offset );
0 commit comments