Failed Conditions
Push — master ( 01c1f3...37c7e1 )
by Zbigniew
04:47
created

ErrorMessage::generate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 10
Ratio 100 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 10
loc 10
ccs 5
cts 5
cp 1
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the zibios/sharep.
7
 *
8
 * (c) Zbigniew Ślązak
9
 */
10
11
namespace App\Slack\SlashCommand\Sharep;
12
13
use App\Slack\MessageBuilder\Layout;
14
use App\Slack\MessageBuilder\MessageFactory;
15
16 View Code Duplication
class ErrorMessage
0 ignored issues
show
Duplication introduced by
This class 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...
17
{
18
    /** @var MessageFactory */
19
    private $messageFactory;
20
21 3
    public function __construct(MessageFactory $messageFactory)
22
    {
23 3
        $this->messageFactory = $messageFactory;
24 3
    }
25
26 3
    public function generate(): Layout
27
    {
28 3
        $mf = $this->messageFactory;
29
30 3
        return $mf->layout(
31 3
            $mf->blockSection(
32 3
                $mf->elementPlainText('Error: Something goes completely wrong!')
33
            )
34
        );
35
    }
36
}
37