mirror of
https://github.com/flarum/core.git
synced 2025-10-18 10:16:09 +02:00
Get rid of Repository interfaces
This commit is contained in:
@@ -2,10 +2,15 @@
|
||||
|
||||
use Flarum\Core\Users\User;
|
||||
|
||||
class EloquentNotificationRepository implements NotificationRepositoryInterface
|
||||
class NotificationRepository
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
* Find a user's notifications.
|
||||
*
|
||||
* @param User $user
|
||||
* @param int|null $limit
|
||||
* @param int $offset
|
||||
* @return \Illuminate\Database\Eloquent\Collection
|
||||
*/
|
||||
public function findByUser(User $user, $limit = null, $offset = 0)
|
||||
{
|
@@ -1,16 +0,0 @@
|
||||
<?php namespace Flarum\Core\Notifications;
|
||||
|
||||
use Flarum\Core\Users\User;
|
||||
|
||||
interface NotificationRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* Find a user's notifications.
|
||||
*
|
||||
* @param User $user
|
||||
* @param int|null $count
|
||||
* @param int $start
|
||||
* @return \Illuminate\Database\Eloquent\Collection
|
||||
*/
|
||||
public function findByUser(User $user, $count = null, $start = 0);
|
||||
}
|
@@ -27,7 +27,7 @@ class NotificationSyncer
|
||||
protected $sentTo = [];
|
||||
|
||||
/**
|
||||
* @var NotificationRepositoryInterface
|
||||
* @var NotificationRepository
|
||||
*/
|
||||
protected $notifications;
|
||||
|
||||
@@ -37,11 +37,11 @@ class NotificationSyncer
|
||||
protected $mailer;
|
||||
|
||||
/**
|
||||
* @param NotificationRepositoryInterface $notifications
|
||||
* @param NotificationRepository $notifications
|
||||
* @param NotificationMailer $mailer
|
||||
*/
|
||||
public function __construct(
|
||||
NotificationRepositoryInterface $notifications,
|
||||
NotificationRepository $notifications,
|
||||
NotificationMailer $mailer
|
||||
) {
|
||||
$this->notifications = $notifications;
|
||||
|
@@ -28,9 +28,5 @@ class NotificationsServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$this->app->bind(
|
||||
'Flarum\Core\Notifications\NotificationRepositoryInterface',
|
||||
'Flarum\Core\Notifications\EloquentNotificationRepository'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user