Skip to content

Commit d47309b

Browse files
committed
Fix ObjectStorage template in stub
We have to use `TEntity of object` instead of `TEntity`.
1 parent 8a361cf commit d47309b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

stubs/ObjectStorage.stub

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
namespace TYPO3\CMS\Extbase\Persistence;
33

44
/**
5-
* @template TEntity
5+
* @template TEntity of object
66
* @implements \ArrayAccess<string, TEntity>
77
* @implements \Iterator<string, TEntity>
88
* @phpstan-type ObjectStorageInternal array{obj: TEntity, inf: mixed}

tests/Unit/Type/data/object-storage-stub-files.php

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public function foo(): void
2929
}
3030

3131
assertType(self::class . '|null', $objectStorage->offsetGet(0));
32+
assertType(self::class . '|null', $objectStorage->current());
3233

3334
// We ignore errors in the next line as this will produce an
3435
// "Offset 0 does not exist on TYPO3\CMS\Extbase\Persistence\ObjectStorage<ObjectStorage\My\Test\Extension\Domain\Model\MyModel>

0 commit comments

Comments
 (0)