lib/Doctrine/ORM/UnitOfWork.php
changed.
lib/Doctrine/ORM/Query.php
changed.
Other files ignored by Codecov
216 | 216 | /** |
|
217 | 217 | * All pending collection deletions. |
|
218 | 218 | * |
|
219 | - | * @psalm-var array<int, Collection<array-key, object>> |
|
219 | + | * @psalm-var array<int, PersistentCollection<array-key, object>> |
|
220 | 220 | */ |
|
221 | 221 | private array $collectionDeletions = []; |
|
222 | 222 | ||
223 | 223 | /** |
|
224 | 224 | * All pending collection updates. |
|
225 | 225 | * |
|
226 | - | * @psalm-var array<int, Collection<array-key, object>> |
|
226 | + | * @psalm-var array<int, PersistentCollection<array-key, object>> |
|
227 | 227 | */ |
|
228 | 228 | private array $collectionUpdates = []; |
|
229 | 229 |
232 | 232 | * At the end of the UnitOfWork all these collections will make new snapshots |
|
233 | 233 | * of their data. |
|
234 | 234 | * |
|
235 | - | * @psalm-var array<int, Collection<array-key, object>> |
|
235 | + | * @psalm-var array<int, PersistentCollection<array-key, object>> |
|
236 | 236 | */ |
|
237 | 237 | private array $visitedCollections = []; |
|
238 | 238 |
374 | 374 | try { |
|
375 | 375 | // Collection deletions (deletions of complete collections) |
|
376 | 376 | foreach ($this->collectionDeletions as $collectionToDelete) { |
|
377 | - | if (! $collectionToDelete instanceof PersistentCollection) { |
|
378 | - | $this->getCollectionPersister($collectionToDelete->getMapping())->delete($collectionToDelete); |
|
379 | - | ||
380 | - | continue; |
|
381 | - | } |
|
382 | - | ||
383 | 377 | // Deferred explicit tracked collections can be removed only when owning relation was persisted |
|
384 | 378 | $owner = $collectionToDelete->getOwner(); |
|
385 | 379 |
2792 | 2786 | /** |
|
2793 | 2787 | * Gets the currently scheduled complete collection deletions |
|
2794 | 2788 | * |
|
2795 | - | * @psalm-return array<int, Collection<array-key, object>> |
|
2789 | + | * @psalm-return array<int, PersistentCollection<array-key, object>> |
|
2796 | 2790 | */ |
|
2797 | 2791 | public function getScheduledCollectionDeletions(): array |
|
2798 | 2792 | { |
2802 | 2796 | /** |
|
2803 | 2797 | * Gets the currently scheduled collection inserts, updates and deletes. |
|
2804 | 2798 | * |
|
2805 | - | * @psalm-return array<int, Collection<array-key, object>> |
|
2799 | + | * @psalm-return array<int, PersistentCollection<array-key, object>> |
|
2806 | 2800 | */ |
|
2807 | 2801 | public function getScheduledCollectionUpdates(): array |
|
2808 | 2802 | { |
85 | 85 | * |
|
86 | 86 | * @param EntityManagerInterface $em The EntityManager the collection will be associated with. |
|
87 | 87 | * @param ClassMetadata $class The class descriptor of the entity type of this collection. |
|
88 | - | * @psalm-param Collection<TKey, T> $collection The collection elements. |
|
88 | + | * @psalm-param Collection<TKey, T>&Selectable<TKey, T> $collection The collection elements. |
|
89 | 89 | */ |
|
90 | 90 | public function __construct( |
|
91 | 91 | EntityManagerInterface $em, |
612 | 612 | /** |
|
613 | 613 | * Retrieves the wrapped Collection instance. |
|
614 | 614 | * |
|
615 | - | * @return Collection<TKey, T> |
|
615 | + | * @return Collection<TKey, T>&Selectable<TKey, T> |
|
616 | 616 | */ |
|
617 | 617 | public function unwrap(): Collection |
|
618 | 618 | { |
|
619 | - | assert($this->collection !== null); |
|
619 | + | assert($this->collection instanceof Collection); |
|
620 | + | assert($this->collection instanceof Selectable); |
|
620 | 621 | ||
621 | 622 | return $this->collection; |
|
622 | 623 | } |
Files | Coverage |
---|---|
lib/Doctrine/ORM | 89.64% |
Project Totals (330 files) | 89.64% |