lib/Doctrine/ORM/UnitOfWork.php
changed.
Other files ignored by Codecov
phpstan-baseline.neon
has changed.
97 | 97 | * |
|
98 | 98 | * @param EntityManagerInterface $em The EntityManager the collection will be associated with. |
|
99 | 99 | * @param ClassMetadata $class The class descriptor of the entity type of this collection. |
|
100 | - | * @psalm-param Collection<TKey, T> $collection The collection elements. |
|
100 | + | * @psalm-param Collection<TKey, T>&Selectable<TKey, T> $collection The collection elements. |
|
101 | 101 | */ |
|
102 | 102 | public function __construct(EntityManagerInterface $em, $class, Collection $collection) |
|
103 | 103 | { |
675 | 675 | /** |
|
676 | 676 | * Retrieves the wrapped Collection instance. |
|
677 | 677 | * |
|
678 | - | * @return Collection<TKey, T> |
|
678 | + | * @return Collection<TKey, T>&Selectable<TKey, T> |
|
679 | 679 | */ |
|
680 | 680 | public function unwrap(): Collection |
|
681 | 681 | { |
|
682 | - | assert($this->collection !== null); |
|
682 | + | assert($this->collection instanceof Collection); |
|
683 | + | assert($this->collection instanceof Selectable); |
|
683 | 684 | ||
684 | 685 | return $this->collection; |
|
685 | 686 | } |
222 | 222 | /** |
|
223 | 223 | * All pending collection deletions. |
|
224 | 224 | * |
|
225 | - | * @psalm-var array<int, Collection<array-key, object>> |
|
225 | + | * @psalm-var array<int, PersistentCollection<array-key, object>> |
|
226 | 226 | */ |
|
227 | 227 | private $collectionDeletions = []; |
|
228 | 228 | ||
229 | 229 | /** |
|
230 | 230 | * All pending collection updates. |
|
231 | 231 | * |
|
232 | - | * @psalm-var array<int, Collection<array-key, object>> |
|
232 | + | * @psalm-var array<int, PersistentCollection<array-key, object>> |
|
233 | 233 | */ |
|
234 | 234 | private $collectionUpdates = []; |
|
235 | 235 |
238 | 238 | * At the end of the UnitOfWork all these collections will make new snapshots |
|
239 | 239 | * of their data. |
|
240 | 240 | * |
|
241 | - | * @psalm-var array<int, Collection<array-key, object>> |
|
241 | + | * @psalm-var array<int, PersistentCollection<array-key, object>> |
|
242 | 242 | */ |
|
243 | 243 | private $visitedCollections = []; |
|
244 | 244 |
419 | 419 | try { |
|
420 | 420 | // Collection deletions (deletions of complete collections) |
|
421 | 421 | foreach ($this->collectionDeletions as $collectionToDelete) { |
|
422 | - | if (! $collectionToDelete instanceof PersistentCollection) { |
|
423 | - | $this->getCollectionPersister($collectionToDelete->getMapping())->delete($collectionToDelete); |
|
424 | - | ||
425 | - | continue; |
|
426 | - | } |
|
427 | - | ||
428 | 422 | // Deferred explicit tracked collections can be removed only when owning relation was persisted |
|
429 | 423 | $owner = $collectionToDelete->getOwner(); |
|
430 | 424 |
3376 | 3370 | /** |
|
3377 | 3371 | * Gets the currently scheduled complete collection deletions |
|
3378 | 3372 | * |
|
3379 | - | * @psalm-return array<int, Collection<array-key, object>> |
|
3373 | + | * @psalm-return array<int, PersistentCollection<array-key, object>> |
|
3380 | 3374 | */ |
|
3381 | 3375 | public function getScheduledCollectionDeletions() |
|
3382 | 3376 | { |
3386 | 3380 | /** |
|
3387 | 3381 | * Gets the currently scheduled collection inserts, updates and deletes. |
|
3388 | 3382 | * |
|
3389 | - | * @psalm-return array<int, Collection<array-key, object>> |
|
3383 | + | * @psalm-return array<int, PersistentCollection<array-key, object>> |
|
3390 | 3384 | */ |
|
3391 | 3385 | public function getScheduledCollectionUpdates() |
|
3392 | 3386 | { |
Files | Coverage |
---|---|
lib/Doctrine/ORM | 84.75% |
Project Totals (371 files) | 84.75% |