Code Duplication    Length = 21-24 lines in 2 locations

src/Slack/SlashCommand/Sharep/ErrorMessage.php 1 location

@@ 16-36 (lines=21) @@
13
use App\Slack\MessageBuilder\Layout;
14
use App\Slack\MessageBuilder\MessageFactory;
15
16
class ErrorMessage
17
{
18
    /** @var MessageFactory */
19
    private $messageFactory;
20
21
    public function __construct(MessageFactory $messageFactory)
22
    {
23
        $this->messageFactory = $messageFactory;
24
    }
25
26
    public function generate(): Layout
27
    {
28
        $mf = $this->messageFactory;
29
30
        return $mf->layout(
31
            $mf->blockSection(
32
                $mf->elementPlainText('Error: Something goes completely wrong!')
33
            )
34
        );
35
    }
36
}
37

src/Slack/SlashCommand/Sharep/SharepHelpMessage.php 1 location

@@ 16-39 (lines=24) @@
13
use App\Slack\MessageBuilder\Layout;
14
use App\Slack\MessageBuilder\MessageFactory;
15
16
class SharepHelpMessage
17
{
18
    /** @var MessageFactory */
19
    private $messageFactory;
20
21
    public function __construct(MessageFactory $messageFactory)
22
    {
23
        $this->messageFactory = $messageFactory;
24
    }
25
26
    public function generate(): Layout
27
    {
28
        $mf = $this->messageFactory;
29
30
        return $mf->layout(
31
            $mf->blockSection(
32
                $mf->elementPlainText('Please try again, proper commands are:')
33
            ),
34
            $mf->blockSection(
35
                $mf->elementPlainText('/sharep release')
36
            )
37
        );
38
    }
39
}
40