Passed
Branch develop (8534ca)
by Aleksandr
03:12
created

BukkitCommandWrapper::version()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace AlexCool\Rcon\Command\Wrapper\Minecraft;
4
5
/**
6
 * @package AlexCool\Rcon\Command\Wrapper\Minecraft
7
 */
8
final class BukkitCommandWrapper extends CoreCommandWrapper
9
{
10
    /**
11
     * Command list
12
     */
13
    const VERSION_COMMAND = 'version';
14
    const PLUGINS_COMMAND = 'plugins';
15
    const RELOAD_COMMAND = 'reload';
16
    const TIMINGS_COMMAND = 'timings';
17
18
    /**
19
     * Gives the version number of CraftBukkit which is installed on the server.
20
     *
21
     * @return bool|mixed
22
     */
23
    public function version()
24
    {
25
        return $this->sendCommand(self::VERSION_COMMAND);
26
    }
27
28
    /**
29
     * Lists all installed plugins on the server.
30
     *
31
     * @return bool|mixed
32
     */
33
    public function plugins()
34
    {
35
        return $this->sendCommand(self::PLUGINS_COMMAND);
36
    }
37
38
    /**
39
     * Stops and restarts all plugins on the server.
40
     *
41
     * @return bool|mixed
42
     */
43
    public function reload()
44
    {
45
        return $this->sendCommand(self::RELOAD_COMMAND);
46
    }
47
48
    /**
49
     * Records timings for all plugin events.
50
     *
51
     * @param string $option
52
     *
53
     * @return bool|mixed
54
     */
55
    public function timings(string $option)
56
    {
57
        $this->commandFormatter
58
            ->addElement('%s', self::TIMINGS_COMMAND)
59
            ->addElement('%s', $option);
60
61
        return $this->sendCommand($this->commandFormatter->compile());
62
    }
63
}
64