1
0
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:
Toby Zerner
2015-07-04 18:38:59 +09:30
parent f7b6d8a568
commit 86811c6508
43 changed files with 203 additions and 341 deletions

View File

@@ -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)
{

View File

@@ -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);
}

View File

@@ -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;

View File

@@ -28,9 +28,5 @@ class NotificationsServiceProvider extends ServiceProvider
*/
public function register()
{
$this->app->bind(
'Flarum\Core\Notifications\NotificationRepositoryInterface',
'Flarum\Core\Notifications\EloquentNotificationRepository'
);
}
}