Completed
Push — dev ( e65940...ade326 )
by
unknown
03:35
created

AdminReturnCommand::getDescription()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace eXpansion\Bundle\AdminChat\ChatCommand;
4
5
use eXpansion\Framework\AdminGroups\Helpers\AdminGroups;
6
use eXpansion\Framework\Core\Helpers\ChatNotification;
7
use eXpansion\Framework\Core\Storage\PlayerStorage;
8
use Maniaplanet\DedicatedServer\Connection;
9
use Monolog\Logger;
10
use Psr\Log\LoggerInterface;
11
use Symfony\Component\Console\Input\InputArgument;
12
use Symfony\Component\Console\Input\InputInterface;
13
14
/**
15
 * Class ReasonUserCommand
16
 *
17
 * @author  Reaby
18
 * @package eXpansion\Bundle\AdminChat\ChatCommand
19
 */
20
class AdminReturnCommand extends AdminCommand
21
{
22
23
    /**
24
     * @inheritdoc
25
     */
26
    public function execute($login, InputInterface $input)
27
    {
28
        $nickName = $this->playerStorage->getPlayerInfo($login)->getNickName();
29
        $group = $this->adminGroupsHelper->getLoginUserGroups($login)->getName();
30
31
        $return = $this->connection->{$this->functionName}();
32
33
        $this->chatNotification->sendMessage(
34
            $this->chatMessage,
35
            $this->isPublic ? null : $login,
36
            ['%adminLevel%' => $group, '%admin%' => $nickName, '%return%' => $return]
37
        );
38
39
    }
40
}
41