Completed
Pull Request — master (#59)
by
unknown
06:30 queued 03:21
created

AdminReturnCommand::execute()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 14
Code Lines 8

Duplication

Lines 14
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 14
loc 14
ccs 0
cts 11
cp 0
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 8
nc 1
nop 2
crap 6
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 View Code Duplication
    public function execute($login, InputInterface $input)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
27
    {
28
        $nickName = $this->playerStorage->getPlayerInfo($login)->getNickName();
29
        $group = $this->getGroupLabel($login);
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