DefaultConfig::getPort()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * Copyright (c) 2018 VectorNetworkProject. All rights reserved. MIT license.
4
 *
5
 * GitHub: https://github.com/VectorNetworkProject/TheMix
6
 * Website: https://www.vector-network.tk
7
 */
8
9
namespace VectorNetworkProject\TheMix\game;
10
11
use VectorNetworkProject\TheMix\TheMix;
12
13
class DefaultConfig
0 ignored issues
show
Coding Style introduced by
DefaultConfig does not seem to conform to the naming convention (Utils?$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
14
{
15
    /** @var string */
16
    const VERSION = 'version';
17
18
    /** @var string */
19
    const STAGE_NAME = 'stage-world-name';
20
21
    /** @var string */
22
    const DEVELOP_MODE = 'dev-mode';
23
24
    /** @var string */
25
    const EVENT_TIME = 'event-time';
26
27
    /** @var string */
28
    const TIMEZONE = 'timezone';
29
30
    /** @var string */
31
    const BLOCK_ID = 'join-block-id';
32
33
    /** @var string */
34
    const RED = 'red';
35
36
    /** @var string */
37
    const BLUE = 'blue';
38
39
    /**
40
     * @return int
41
     */
42
    public static function getVersion(): int
43
    {
44
        return TheMix::getInstance()->getConfig()->get(self::VERSION);
45
    }
46
47
    /**
48
     * @return string
49
     */
50
    public static function getStageLevelName(): string
51
    {
52
        return TheMix::getInstance()->getConfig()->get(self::STAGE_NAME);
53
    }
54
55
    /**
56
     * @return bool
57
     */
58
    public static function isDev(): bool
59
    {
60
        return TheMix::getInstance()->getConfig()->get(self::DEVELOP_MODE);
61
    }
62
63
    /**
64
     * @return int
65
     */
66
    public static function getEventTime(): int
67
    {
68
        return TheMix::getInstance()->getConfig()->get(self::EVENT_TIME);
69
    }
70
71
    /**
72
     * @return string
73
     */
74
    public static function getTimezone(): string
75
    {
76
        return TheMix::getInstance()->getConfig()->get(self::TIMEZONE);
77
    }
78
79
    /**
80
     * @return int
81
     */
82
    public static function getBlockId(): int
83
    {
84
        return TheMix::getInstance()->getConfig()->get(self::BLOCK_ID);
85
    }
86
87
    /**
88
     * @return string
89
     */
90
    public static function getIp(): string
91
    {
92
        return TheMix::getInstance()->getConfig()->get('ip');
93
    }
94
95
    /**
96
     * @return int
97
     */
98
    public static function getPort(): int
99
    {
100
        return TheMix::getInstance()->getConfig()->get('port');
101
    }
102
103
    /**
104
     * @return array
105
     */
106
    public static function getRedConfig(): array
107
    {
108
        return TheMix::getInstance()->getConfig()->get(self::RED);
109
    }
110
111
    /**
112
     * @return array
113
     */
114
    public static function getBlueConfig(): array
115
    {
116
        return TheMix::getInstance()->getConfig()->get(self::BLUE);
117
    }
118
}
119