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

UserSettingEnum::isDistinctSetting()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 3
eloc 5
c 1
b 1
f 0
nc 2
nop 0
dl 0
loc 10
ccs 0
cts 5
cp 0
crap 12
rs 10
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