Passed
Push — dev ( 9b9d73...47b4bf )
by Janko
24:50
created

UserSettingEnum   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 18
c 2
b 1
f 0
dl 0
loc 28
ccs 0
cts 5
cp 0
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A isDistinctSetting() 0 10 3
1
<?php
2
3
namespace Stu\Module\PlayerSetting\Lib;
4
5
enum UserSettingEnum: string
6
{
7
    case AVATAR = 'avatar';
8
    case RGB_CODE = 'rgb_code';
9
    case EMAIL_NOTIFICATION = 'email_notification';
10
    case STORAGE_NOTIFICATION = 'storage_notification';
11
    case SAVE_LOGIN = 'save_login';
12
    case DEFAULT_VIEW = 'default_view';
13
    case SHOW_ONLINE_STATUS = 'show_online_status';
14
    case SHOW_PM_READ_RECEIPT = 'show_pm_read_receipt';
15
    case FLEET_FIXED_DEFAULT = 'fleet_fixed_default';
16
    case WARPSPLIT_AUTO_CARRYOVER_DEFAULT = 'warpsplit_auto_carryover_default';
17
    case RPG_BEHAVIOR = 'rpg_behavior';
18
    case CSS_COLOR_SHEET = 'css_color_sheet';
19
20
    /**
21
     * returns true, if the setting has it's own action controller
22
     */
23
    public function isDistinctSetting(): bool
24
    {
25
        if (
26
            $this === self::AVATAR
27
            || $this === self::RGB_CODE
28
        ) {
29
            return true;
30
        }
31
32
        return false;
33
    }
34
}
35