GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( bcf71b...1d605a )
by Yash
02:01
created

LogNotificationClass   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A info() 0 4 1
A error() 0 4 1
A log() 0 9 1
1
<?php
2
3
namespace Webelightdev\LaravelPushNotification\Classes;
4
5
use Illuminate\Support\Facades\DB;
6
7
/**
8
 * Log Notification Class.
9
 */
10
class LogNotificationClass
11
{
12
    protected $logTable;
13
14
    public function __construct()
15
    {
16
        $this->logTable = config('push-notification.logs.table');
17
    }
18
19
    public function info($deviceToken, $notification, $errorMessage = null)
20
    {
21
        $this->log($deviceToken, $notification, $errorMessage, 'success');
22
    }
23
24
    public function error($deviceToken, $notification, $errorMessage)
25
    {
26
        $this->log($deviceToken, $notification, $errorMessage, 'failure');
27
    }
28
29
    public function log($deviceToken, $notification, $errorMessage, $status)
30
    {
31
        DB::table($this->logTable)->insert([
32
            'device_token'         => $deviceToken,
33
            'notification_message' => $notification,
34
            'error_message'        => $errorMessage,
35
            'status'               => $status,
36
        ]);
37
    }
38
}
39