Skip to content

Commit 34f5ef6

Browse files
authored
Add phpstan assertions for last in Collection isEmpty and isNotEmpty (#53107)
1 parent c004ffc commit 34f5ef6

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/Illuminate/Collections/Collection.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,8 +690,10 @@ public function intersectByKeys($items)
690690
* Determine if the collection is empty or not.
691691
*
692692
* @phpstan-assert-if-true null $this->first()
693+
* @phpstan-assert-if-true null $this->last()
693694
*
694695
* @phpstan-assert-if-false TValue $this->first()
696+
* @phpstan-assert-if-false TValue $this->last()
695697
*
696698
* @return bool
697699
*/

src/Illuminate/Collections/Traits/EnumeratesValues.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,10 @@ public function ensure($type)
366366
* Determine if the collection is not empty.
367367
*
368368
* @phpstan-assert-if-true TValue $this->first()
369+
* @phpstan-assert-if-true TValue $this->last()
369370
*
370371
* @phpstan-assert-if-false null $this->first()
372+
* @phpstan-assert-if-false null $this->last()
371373
*
372374
* @return bool
373375
*/

0 commit comments

Comments
 (0)