Skip to content

Commit

Permalink
Add phpstan assertions for last in Collection isEmpty and isNotEmpty (l…
Browse files Browse the repository at this point in the history
  • Loading branch information
bastien-phi authored and timacdonald committed Oct 15, 2024
1 parent e0f0e39 commit 938d05e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Illuminate/Collections/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -690,8 +690,10 @@ public function intersectByKeys($items)
* Determine if the collection is empty or not.
*
* @phpstan-assert-if-true null $this->first()
* @phpstan-assert-if-true null $this->last()
*
* @phpstan-assert-if-false TValue $this->first()
* @phpstan-assert-if-false TValue $this->last()
*
* @return bool
*/
Expand Down
2 changes: 2 additions & 0 deletions src/Illuminate/Collections/Traits/EnumeratesValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,10 @@ public function ensure($type)
* Determine if the collection is not empty.
*
* @phpstan-assert-if-true TValue $this->first()
* @phpstan-assert-if-true TValue $this->last()
*
* @phpstan-assert-if-false null $this->first()
* @phpstan-assert-if-false null $this->last()
*
* @return bool
*/
Expand Down

0 comments on commit 938d05e

Please sign in to comment.