File tree 1 file changed +26
-2
lines changed
1 file changed +26
-2
lines changed Original file line number Diff line number Diff line change 10
10
use TypeLang \PHPDoc \Tag \TagProviderInterface ;
11
11
12
12
/**
13
- * @template-implements \IteratorAggregate<array-key, Tag>
13
+ * @template-implements \IteratorAggregate<int<0, max>, Tag>
14
+ * @template-implements \ArrayAccess<int<0, max>, Tag|null>
14
15
*/
15
- final class DocBlock implements TagProviderInterface, \IteratorAggregate
16
+ final class DocBlock implements
17
+ TagProviderInterface,
18
+ \IteratorAggregate,
19
+ \ArrayAccess
16
20
{
17
21
use TagProvider;
18
22
@@ -26,6 +30,26 @@ public function __construct(
26
30
$ this ->bootTagProvider ($ tags );
27
31
}
28
32
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
+
29
53
public function getDescription (): Description
30
54
{
31
55
return $ this ->description ;
You can’t perform that action at this time.
0 commit comments