NotificationsController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 4
dl 0
loc 19
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A markAsRead() 0 6 1
1
<?php
2
3
namespace Modules\Notification\Http\Controllers\Api;
4
5
use Illuminate\Http\Request;
6
use Illuminate\Routing\Controller;
7
use Modules\Notification\Repositories\NotificationRepository;
8
9
class NotificationsController extends Controller
10
{
11
    /**
12
     * @var NotificationRepository
13
     */
14
    private $notification;
15
16
    public function __construct(NotificationRepository $notification)
17
    {
18
        $this->notification = $notification;
19
    }
20
21
    public function markAsRead(Request $request)
22
    {
23
        $updated = $this->notification->markNotificationAsRead($request->get('id'));
24
25
        return response()->json(compact('updated'));
26
    }
27
}
28