SplashMessage   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 17
dl 0
loc 31
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get404() 0 3 1
A get() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Minepic\Misc;
6
7
/**
8
 * Class SplashMessage.
9
 */
10
class SplashMessage
11
{
12
    protected static array $messages = [
13
        'Over 9000 avatars!!',
14
        'Serving since 2013',
15
        'Just select and copy the URL, come on!',
16
        'How can I help you?',
17
        'RTFM!',
18
        'Whoooooops!',
19
        'Many avatars, Wow!',
20
    ];
21
22
    protected static array $messages404 = [
23
        'Oooops! 404 :(',
24
        'Page is gone',
25
        'This page has been stolen by an Enderman',
26
        'This page has a drop rate of 0%',
27
        'This is not a page',
28
    ];
29
30
    /**
31
     * get random message.
32
     */
33
    public static function get(): string
34
    {
35
        return self::$messages[array_rand(self::$messages)];
36
    }
37
38
    public static function get404(): string
39
    {
40
        return self::$messages404[array_rand(self::$messages404)];
41
    }
42
}
43