Completed
Pull Request — master (#7)
by Vojta
01:30
created

Settings::getSwiftmailerLevelOptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace VojtaSvoboda\ErrorLogger\Models;
4
5
use October\Rain\Database\Model;
6
use October\Rain\Database\Traits\Validation as ValidationTrait;
7
8
class Settings extends Model
9
{
10
    use ValidationTrait;
11
12
    public $implement = ['System.Behaviors.SettingsModel'];
13
14
    // A unique code
15
    public $settingsCode = 'vojtasvoboda_errorlogger_settings';
16
17
    // Reference to field configuration
18
    public $settingsFields = 'fields.yaml';
19
20
    public $rules = [
21
        // 'nativemailer_email' => 'email',
0 ignored issues
show
Unused Code Comprehensibility introduced by
58% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
22
    ];
23
24
    public $attributeNames = [
25
        'nativemailer_email' => "Developer's email",
26
        'swiftmailer_email' => "Developer's email",
27
    ];
28
29
    public static function getNativemailerLevelOptions()
30
    {
31
        return self::getErrorLevelOptions();
32
    }
33
34
    public static function getSwiftmailerLevelOptions()
35
    {
36
        return self::getErrorLevelOptions();
37
    }
38
39
    public static function getSlackLevelOptions()
40
    {
41
        return self::getErrorLevelOptions();
42
    }
43
44
    public static function getSyslogLevelOptions()
45
    {
46
        return self::getErrorLevelOptions();
47
    }
48
49
    public static function getNewrelicLevelOptions()
50
    {
51
        return self::getErrorLevelOptions();
52
    }
53
54
    public static function getErrorLevelOptions()
55
    {
56
        return [
57
            100 => 'Debug - Level 100 - Detailed debug information',
58
            200 => 'Info - Level 200 - Interesting events e.g. user logs in, SQL logs',
59
            250 => 'Notice - Level 250 - Uncommon events',
60
            300 => 'Warning - Level 300 - Exceptional occurrences that are not errors',
61
            400 => 'Error - Level 400 - Runtime errors',
62
            500 => 'Critical - Level 500 - Critical conditions',
63
            550 => 'Alert - Level 550 - Action must be taken immediately',
64
            600 => 'Emergency - Level 600 - Urgent alert'
65
        ];
66
    }
67
}
68