Code Duplication    Length = 20-21 lines in 2 locations

src/eXpansion/Bundle/AdminChat/ChatCommand/OneParameterCommand.php 1 location

@@ 114-134 (lines=21) @@
111
    /**
112
     * @inheritdoc
113
     */
114
    public function execute($login, InputInterface $input)
115
    {
116
        $nickName = $this->playerStorage->getPlayerInfo($login)->getNickName();
117
        $parameter = $input->getArgument('parameter');
118
        $group = $this->getGroupLabel($login);
119
        try {
120
            $this->connection->{$this->functionName}($parameter);
121
            $this->chatNotification->sendMessage(
122
                $this->chatMessage,
123
                $this->isPublic ? null : $login,
124
                ['%adminLevel%' => $group, '%admin%' => $nickName, "%parameter%" => $parameter]
125
            );
126
        } catch (\Exception $e) {
127
            $this->chatNotification->sendMessage(
128
                'expansion_admin_chat.dedicatedexception',
129
                $login,
130
                ['%message%' => $e->getMessage()]
131
            );
132
        }
133
134
    }
135
}
136

src/eXpansion/Bundle/AdminChat/ChatCommand/TimeParameterCommand.php 1 location

@@ 67-86 (lines=20) @@
64
    /**
65
     * @inheritdoc
66
     */
67
    public function execute($login, InputInterface $input)
68
    {
69
        $nickName = $this->playerStorage->getPlayerInfo($login)->getNickName();
70
        $parameter = $this->timeHelper->textToTime($input->getArgument('parameter'));
71
        $group = $this->getGroupLabel($login);
72
        try {
73
            $this->connection->{$this->functionName}($parameter);
74
            $this->chatNotification->sendMessage(
75
                $this->chatMessage,
76
                $this->isPublic ? null : $login,
77
                ['%adminLevel%' => $group, '%admin%' => $nickName, "%parameter%" => $parameter]
78
            );
79
        } catch (\Exception $e) {
80
            $this->chatNotification->sendMessage(
81
                'expansion_admin_chat.dedicatedexception',
82
                $login,
83
                ['%message%' => $e->getMessage()]
84
            );
85
        }
86
    }
87
88
    /**
89
     * @param string $parameterDescription