|
2 | 2 | namespace TYPO3\CMS\Extbase\Persistence; |
3 | 3 |
|
4 | 4 | /** |
5 | | - * @template TKey of object |
6 | | - * @template TEntity of object |
| 5 | + * @template TEntity |
| 6 | + * @implements \ArrayAccess<string, TEntity> |
| 7 | + * @implements \Iterator<string, TEntity> |
7 | 8 | * @phpstan-type ObjectStorageInternal array{obj: TEntity, inf: mixed} |
8 | | - * @implements \ArrayAccess<TKey, TEntity> |
9 | | - * @implements \Iterator<TKey, TEntity> |
10 | 9 | */ |
11 | | -class ObjectStorage implements \Countable, \Iterator, \ArrayAccess, ObjectMonitoringInterface |
| 10 | +class ObjectStorage implements \Iterator, \ArrayAccess |
12 | 11 | { |
13 | 12 | /** |
14 | 13 | * @var array<string, ObjectStorageInternal> |
15 | 14 | */ |
16 | | - protected array $storage; |
| 15 | + protected $storage; |
17 | 16 |
|
18 | 17 | /** |
19 | | - * @phpstan-param TEntity $offset |
20 | | - * @param ObjectStorageInternal $information |
| 18 | + * @param TEntity|string|null $value |
| 19 | + * @param mixed $information |
21 | 20 | */ |
22 | | - public function offsetSet(mixed $offset, mixed $information): void; |
| 21 | + public function offsetSet($value, $information); |
23 | 22 |
|
24 | 23 | /** |
25 | | - * @param TEntity|int $value |
| 24 | + * @param TEntity|int|string $value |
26 | 25 | * @return bool |
27 | 26 | */ |
28 | | - public function offsetExists(mixed $value); |
| 27 | + public function offsetExists($value); |
29 | 28 |
|
30 | 29 | /** |
31 | | - * @param TEntity|int $value |
| 30 | + * @param TEntity|int|string $value |
32 | 31 | */ |
33 | | - public function offsetUnset(mixed $value): void; |
| 32 | + public function offsetUnset($value); |
34 | 33 |
|
35 | 34 | /** |
36 | | - * @param TEntity|int $value |
37 | | - * @return ($value is int ? TEntity|null : ObjectStorageInternal) |
| 35 | + * @param TEntity|int|string $value |
| 36 | + * @return ($value is int ? TEntity|null : mixed) |
38 | 37 | */ |
39 | | - public function offsetGet(mixed $value); |
| 38 | + public function offsetGet($value); |
| 39 | + |
| 40 | + /** |
| 41 | + * This is different from the SplObjectStorage as the key in this implementation is the object hash (string). |
| 42 | + * @phpstan-ignore-next-line See https://forge.typo3.org/issues/98146 |
| 43 | + * @return string |
| 44 | + */ |
| 45 | + // @phpstan-ignore-next-line See https://forge.typo3.org/issues/98146 |
| 46 | + public function key(); |
| 47 | + |
| 48 | + /** |
| 49 | + * @return list<TEntity> |
| 50 | + */ |
| 51 | + public function toArray(); |
| 52 | + |
| 53 | + /** |
| 54 | + * @return list<TEntity> |
| 55 | + */ |
| 56 | + public function getArray(); |
| 57 | + |
| 58 | + /** |
| 59 | + * @param TEntity $object |
| 60 | + * @return bool |
| 61 | + */ |
| 62 | + public function isRelationDirty($object); |
40 | 63 | } |
0 commit comments