-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Patrick Hesselberg
authored
May 12, 2023
1 parent
3b3e22a
commit da93203
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
types/Database/Eloquent/DatabaseNotificationCollection.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
use function PHPStan\Testing\assertType; | ||
use Illuminate\Notifications\DatabaseNotification; | ||
use Illuminate\Notifications\DatabaseNotificationCollection; | ||
|
||
class CustomNotification extends DatabaseNotification | ||
{ | ||
/** | ||
* @param array<int, CustomNotification> $models | ||
*/ | ||
public function newCollection(array $models = []): CustomNotificationCollection | ||
{ | ||
return new CustomNotificationCollection($models); | ||
} | ||
} | ||
|
||
/** | ||
* @extends DatabaseNotificationCollection<int, CustomNotification> | ||
*/ | ||
class CustomNotificationCollection extends DatabaseNotificationCollection | ||
{ | ||
} | ||
|
||
$databaseNotificationsCollection = DatabaseNotification::all(); | ||
assertType('Illuminate\Database\Eloquent\Collection<int, Illuminate\Notifications\DatabaseNotification>', $databaseNotificationsCollection); | ||
|
||
|
||
$customNotificationsCollection = CustomNotification::all(); | ||
assertType('Illuminate\Database\Eloquent\Collection<int, CustomNotification>', $customNotificationsCollection); |