Completed
Pull Request — master (#8)
by Micheal
12:04
created
Providers/RouteServiceProvider.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     protected $namespace = 'Modules\Notification\Http\Controllers';
12 12
 
13 13
     /**
14
-     * @return string
14
+     * @return boolean
15 15
      */
16 16
     protected function getFrontendRoute()
17 17
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
      */
24 24
     protected function getBackendRoute()
25 25
     {
26
-        return __DIR__ . '/../Http/backendRoutes.php';
26
+        return __DIR__.'/../Http/backendRoutes.php';
27 27
     }
28 28
 
29 29
     /**
@@ -31,6 +31,6 @@  discard block
 block discarded – undo
31 31
      */
32 32
     protected function getApiRoute()
33 33
     {
34
-        return __DIR__ . '/../Http/apiRoutes.php';
34
+        return __DIR__.'/../Http/apiRoutes.php';
35 35
     }
36 36
 }
Please login to merge, or discard this patch.
Database/Migrations/2015_11_17_154243_create_notifications_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
      */
12 12
     public function up()
13 13
     {
14
-        Schema::create('notification__notifications', function (Blueprint $table) {
14
+        Schema::create('notification__notifications', function(Blueprint $table) {
15 15
             $table->increments('id');
16 16
             $table->integer('user_id')->unsigned();
17 17
             $table->string('type')->nullable();
Please login to merge, or discard this patch.
Entities/Notification.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@
 block discarded – undo
16 16
 class Notification extends Model
17 17
 {
18 18
     protected $table = 'notification__notifications';
19
-    protected $fillable = ['user_id', 'type', 'message', 'icon_class', 'link', 'is_read', 'title'];
20
-    protected $appends = ['time_ago'];
19
+    protected $fillable = [ 'user_id', 'type', 'message', 'icon_class', 'link', 'is_read', 'title' ];
20
+    protected $appends = [ 'time_ago' ];
21 21
 
22 22
     /**
23 23
      * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
Please login to merge, or discard this patch.
Repositories/Eloquent/EloquentNotificationRepository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -74,6 +74,6 @@
 block discarded – undo
74 74
      */
75 75
     public function markAllAsReadForUser($userId)
76 76
     {
77
-        return $this->model->whereUserId($userId)->update(['is_read' => true]);
77
+        return $this->model->whereUserId($userId)->update([ 'is_read' => true ]);
78 78
     }
79 79
 }
Please login to merge, or discard this patch.
Events/BroadcastNotification.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,6 +25,6 @@
 block discarded – undo
25 25
      */
26 26
     public function broadcastOn()
27 27
     {
28
-        return ['asgardcms.notifications.' . $this->notification->user_id];
28
+        return [ 'asgardcms.notifications.'.$this->notification->user_id ];
29 29
     }
30 30
 }
Please login to merge, or discard this patch.
Providers/NotificationServiceProvider.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         $this->registerBindings();
36 36
         $this->registerViewComposers();
37 37
 
38
-        $this->app['events']->listen(
38
+        $this->app[ 'events' ]->listen(
39 39
             BuildingSidebar::class,
40 40
             $this->getSidebarClassForModule('blog', RegisterNotificationSidebar::class)
41 41
         );
@@ -60,10 +60,10 @@  discard block
 block discarded – undo
60 60
 
61 61
     private function registerBindings()
62 62
     {
63
-        $this->app->bind(NotificationRepository::class, function () {
63
+        $this->app->bind(NotificationRepository::class, function() {
64 64
                 $repository = new EloquentNotificationRepository(new Notification());
65 65
 
66
-                if (! config('app.cache')) {
66
+                if (!config('app.cache')) {
67 67
                     return $repository;
68 68
                 }
69 69
 
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
             }
72 72
         );
73 73
 
74
-        $this->app->bind(\Modules\Notification\Services\Notification::class, function ($app) {
75
-            return new AsgardNotification($app[NotificationRepository::class], $app[Authentication::class]);
74
+        $this->app->bind(\Modules\Notification\Services\Notification::class, function($app) {
75
+            return new AsgardNotification($app[ NotificationRepository::class ], $app[ Authentication::class ]);
76 76
         });
77 77
     }
78 78
 
Please login to merge, or discard this patch.
Repositories/Cache/CacheNotificationDecorator.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
     public function latestForUser($userId)
22 22
     {
23 23
         return $this->cache
24
-            ->tags([$this->entityName, 'global'])
24
+            ->tags([ $this->entityName, 'global' ])
25 25
             ->remember("{$this->locale}.{$this->entityName}.latestForUser.{$userId}", $this->cacheTime,
26
-                function () use ($userId) {
26
+                function() use ($userId) {
27 27
                     return $this->repository->latestForUser($userId);
28 28
                 }
29 29
             );
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
     public function allForUser($userId)
50 50
     {
51 51
         return $this->cache
52
-            ->tags([$this->entityName, 'global'])
52
+            ->tags([ $this->entityName, 'global' ])
53 53
             ->remember("{$this->locale}.{$this->entityName}.allForUser.{$userId}", $this->cacheTime,
54
-                function () use ($userId) {
54
+                function() use ($userId) {
55 55
                     return $this->repository->allForUser($userId);
56 56
                 }
57 57
             );
@@ -65,9 +65,9 @@  discard block
 block discarded – undo
65 65
     public function allUnreadForUser($userId)
66 66
     {
67 67
         return $this->cache
68
-            ->tags([$this->entityName, 'global'])
68
+            ->tags([ $this->entityName, 'global' ])
69 69
             ->remember("{$this->locale}.{$this->entityName}.allUnreadForUser.{$userId}", $this->cacheTime,
70
-                function () use ($userId) {
70
+                function() use ($userId) {
71 71
                     return $this->repository->allUnreadForUser($userId);
72 72
                 }
73 73
             );
Please login to merge, or discard this patch.
Http/backendRoutes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 use Illuminate\Routing\Router;
4 4
 
5 5
 /** @var Router $router */
6
-$router->group(['prefix' => '/notification'], function (Router $router) {
6
+$router->group([ 'prefix' => '/notification' ], function(Router $router) {
7 7
     $router->get('notifications', [
8 8
         'as' => 'admin.notification.notification.index',
9 9
         'uses' => 'NotificationsController@index',
Please login to merge, or discard this patch.
Http/apiRoutes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,4 +3,4 @@
 block discarded – undo
3 3
 use Illuminate\Routing\Router;
4 4
 
5 5
 /** @var Router $router */
6
-$router->post('notification/mark-read', ['as' => 'api.notification.read', 'uses' => 'NotificationsController@markAsRead']);
6
+$router->post('notification/mark-read', [ 'as' => 'api.notification.read', 'uses' => 'NotificationsController@markAsRead' ]);
Please login to merge, or discard this patch.