Passed
Push — master ( 9aa048...898b5e )
by Mattia
04:05
created

SplashMessage   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 17
dl 0
loc 37
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
    /**
13
     * @var array
14
     */
15
    protected static $messages = [
16
        'Over 9000 avatars!!',
17
        'Serving since 2013',
18
        'Just select and copy the URL, come on!',
19
        'How can I help you?',
20
        'RTFM!',
21
        'Whoooooops!',
22
        'Many avatars, Wow!',
23
    ];
24
25
    /**
26
     * @var array
27
     */
28
    protected static $messages404 = [
29
        'Oooops! 404 :(',
30
        'Page is gone',
31
        'This page has been stolen by an Enderman',
32
        'This page has a drop rate of 0%',
33
        'This is not a page',
34
    ];
35
36
    /**
37
     * get random message.
38
     */
39
    public static function get(): string
40
    {
41
        return self::$messages[\array_rand(self::$messages)];
42
    }
43
44
    public static function get404()
45
    {
46
        return self::$messages404[\array_rand(self::$messages404)];
47
    }
48
}
49