|
27 | 27 | class ObjectHydrator extends AbstractHydrator
|
28 | 28 | {
|
29 | 29 | /** @var mixed[] */
|
30 |
| - private $identifierMap = []; |
| 30 | + private array $identifierMap = []; |
31 | 31 |
|
32 | 32 | /** @var mixed[] */
|
33 |
| - private $resultPointers = []; |
| 33 | + private array $resultPointers = []; |
34 | 34 |
|
35 | 35 | /** @var mixed[] */
|
36 |
| - private $idTemplate = []; |
| 36 | + private array $idTemplate = []; |
37 | 37 |
|
38 |
| - /** @var int */ |
39 |
| - private $resultCounter = 0; |
| 38 | + private int $resultCounter = 0; |
40 | 39 |
|
41 | 40 | /** @var mixed[] */
|
42 |
| - private $rootAliases = []; |
| 41 | + private array $rootAliases = []; |
43 | 42 |
|
44 | 43 | /** @var mixed[] */
|
45 |
| - private $initializedCollections = []; |
| 44 | + private array $initializedCollections = []; |
46 | 45 |
|
47 | 46 | /** @var mixed[] */
|
48 |
| - private $existingCollections = []; |
| 47 | + private array $existingCollections = []; |
49 | 48 |
|
50 | 49 | protected function prepare(): void
|
51 | 50 | {
|
@@ -148,12 +147,11 @@ protected function hydrateAllData(): array
|
148 | 147 | /**
|
149 | 148 | * Initializes a related collection.
|
150 | 149 | *
|
151 |
| - * @param object $entity The entity to which the collection belongs. |
152 | 150 | * @param string $fieldName The name of the field on the entity that holds the collection.
|
153 | 151 | * @param string $parentDqlAlias Alias of the parent fetch joining this collection.
|
154 | 152 | */
|
155 | 153 | private function initRelatedCollection(
|
156 |
| - $entity, |
| 154 | + object $entity, |
157 | 155 | ClassMetadata $class,
|
158 | 156 | string $fieldName,
|
159 | 157 | string $parentDqlAlias
|
@@ -203,11 +201,9 @@ private function initRelatedCollection(
|
203 | 201 | * @param string $dqlAlias The DQL alias of the entity's class.
|
204 | 202 | * @psalm-param array<string, mixed> $data The instance data.
|
205 | 203 | *
|
206 |
| - * @return object |
207 |
| - * |
208 | 204 | * @throws HydrationException
|
209 | 205 | */
|
210 |
| - private function getEntity(array $data, string $dqlAlias) |
| 206 | + private function getEntity(array $data, string $dqlAlias): object |
211 | 207 | {
|
212 | 208 | $className = $this->resultSetMapping()->aliasMap[$dqlAlias];
|
213 | 209 |
|
@@ -252,10 +248,8 @@ private function getEntity(array $data, string $dqlAlias)
|
252 | 248 | /**
|
253 | 249 | * @psalm-param class-string $className
|
254 | 250 | * @psalm-param array<string, mixed> $data
|
255 |
| - * |
256 |
| - * @return mixed |
257 | 251 | */
|
258 |
| - private function getEntityFromIdentityMap(string $className, array $data) |
| 252 | + private function getEntityFromIdentityMap(string $className, array $data): object|bool |
259 | 253 | {
|
260 | 254 | // TODO: Abstract this code and UnitOfWork::createEntity() equivalent?
|
261 | 255 | $class = $this->_metadataCache[$className];
|
|
0 commit comments