@@ -34,9 +34,9 @@ protected function bootTagProvider(iterable $tags): void
34
34
}
35
35
36
36
/**
37
- * @return list<TagInterface>
38
- *@see TagsProviderInterface::getTags()
37
+ * @see TagsProviderInterface::getTags()
39
38
*
39
+ * @return list<TagInterface>
40
40
*/
41
41
public function getTags (): array
42
42
{
@@ -45,11 +45,15 @@ public function getTags(): array
45
45
46
46
public function offsetExists (mixed $ offset ): bool
47
47
{
48
+ assert (\is_int ($ offset ));
49
+
48
50
return isset ($ this ->tags [$ offset ]);
49
51
}
50
52
51
53
public function offsetGet (mixed $ offset ): ?TagInterface
52
54
{
55
+ assert (\is_int ($ offset ));
56
+
53
57
return $ this ->tags [$ offset ] ?? null ;
54
58
}
55
59
@@ -60,6 +64,9 @@ public function offsetGet(mixed $offset): ?TagInterface
60
64
*/
61
65
public function offsetSet (mixed $ offset , mixed $ value ): void
62
66
{
67
+ assert (\is_int ($ offset ));
68
+ assert ($ value instanceof TagInterface);
69
+
63
70
throw new \BadMethodCallException (self ::class . ' objects are immutable ' );
64
71
}
65
72
@@ -70,6 +77,8 @@ public function offsetSet(mixed $offset, mixed $value): void
70
77
*/
71
78
public function offsetUnset (mixed $ offset ): void
72
79
{
80
+ assert (\is_int ($ offset ));
81
+
73
82
throw new \BadMethodCallException (self ::class . ' objects are immutable ' );
74
83
}
75
84
0 commit comments