Completed
Push — master ( c8ea4b...c4213a )
by Sherif
02:51
created

ErrorHandler::tokenExpired()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php namespace App\Modules\Core;
2
3
class ErrorHandler
4
{
5
    public function unAuthorized()
6
    {
7
        return ['status' => 401, 'message' => 'Please login before any action'];
8
    }
9
10
    public function tokenExpired()
11
    {
12
        return ['status' => 401, 'message' => 'Login token expired'];
13
    }
14
15
     public function noPermissions()
16
    {
17
        return ['status' => 401, 'message' => 'No permissions'];
18
    }
19
20
    public function loginFailed()
21
    {
22
        return ['status' => 400, 'message' => 'Wrong mail or password'];
23
    }
24
25
    public function redisNotRunning()
26
    {
27
        return ['status' => 400, 'message' => 'Your redis notification server isn\'t running'];
28
    }
29
30
    public function dbQueryError()
31
    {
32
        return ['status' => 400, 'message' => 'Please check the given inputes'];
33
    }
34
35
    public function cannotCreateSetting()
36
    {
37
        return ['status' => 400, 'message' => 'Can\'t create setting'];
38
    }
39
40
    public function cannotUpdateSettingKey()
41
    {
42
        return ['status' => 400, 'message' => 'Can\'t update setting key'];
43
    }
44
45
    public function notFound($text)
46
    {
47
        return ['status' => 404, 'message' => 'The requested ' . $text . ' not found'];
48
    }
49
}