Completed
Push — master ( b819b4...8115f1 )
by Sherif
14:17
created

CoreErrors   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 7
lcom 0
cbo 0
dl 0
loc 37
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A connectionError() 0 4 1
A redisNotRunning() 0 4 1
A dbQueryError() 0 4 1
A cannotCreateSetting() 0 4 1
A cannotUpdateSettingKey() 0 4 1
A notFound() 0 4 1
A cannotUploadImage() 0 4 1
1
<?php
2
3
namespace App\Modules\Core\Errors;
4
5
class CoreErrors
6
{
7
    public function connectionError()
8
    {
9
        abort(500, trans('core::errors.connectionError'));
10
    }
11
12
    public function redisNotRunning()
13
    {
14
        abort(500, trans('core::errors.redisNotRunning'));
15
    }
16
17
    public function dbQueryError()
18
    {
19
        abort(500, trans('core::errors.dbQueryError'));
20
    }
21
22
    public function cannotCreateSetting()
23
    {
24
        abort(400, trans('core::errors.cannotCreateSetting'));
25
    }
26
27
    public function cannotUpdateSettingKey()
28
    {
29
        abort(400, trans('core::errors.cannotUpdateSettingKey'));
30
    }
31
32
    public function notFound($text)
33
    {
34
        abort(404, trans('core::errors.notFound', ['replace' => $text]));
35
    }
36
37
    public function cannotUploadImage()
38
    {
39
        abort(400, trans('core::errors.cannotUploadImage'));
40
    }
41
}
42