File tree Expand file tree Collapse file tree 1 file changed +26
-2
lines changed Expand file tree Collapse file tree 1 file changed +26
-2
lines changed Original file line number Diff line number Diff line change 1010use TypeLang \PHPDoc \Tag \TagProviderInterface ;
1111
1212/**
13- * @template-implements \IteratorAggregate<array-key, Tag>
13+ * @template-implements \IteratorAggregate<int<0, max>, Tag>
14+ * @template-implements \ArrayAccess<int<0, max>, Tag|null>
1415 */
15- final class DocBlock implements TagProviderInterface, \IteratorAggregate
16+ final class DocBlock implements
17+ TagProviderInterface,
18+ \IteratorAggregate,
19+ \ArrayAccess
1620{
1721 use TagProvider;
1822
@@ -26,6 +30,26 @@ public function __construct(
2630 $ this ->bootTagProvider ($ tags );
2731 }
2832
33+ public function offsetExists (mixed $ offset ): bool
34+ {
35+ return isset ($ this ->tags [$ offset ]);
36+ }
37+
38+ public function offsetGet (mixed $ offset ): ?Tag
39+ {
40+ return $ this ->tags [$ offset ] ?? null ;
41+ }
42+
43+ public function offsetSet (mixed $ offset , mixed $ value ): void
44+ {
45+ throw new \BadMethodCallException (self ::class . ' objects are immutable ' );
46+ }
47+
48+ public function offsetUnset (mixed $ offset ): void
49+ {
50+ throw new \BadMethodCallException (self ::class . ' objects are immutable ' );
51+ }
52+
2953 public function getDescription (): Description
3054 {
3155 return $ this ->description ;
You can’t perform that action at this time.
0 commit comments