Failed Conditions
Push — master ( eac8ff...e4a057 )
by Zbigniew
04:46
created

ErrorMessage   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 21
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A generate() 0 10 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\PredefinedMessage;
12
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 3
    public function __construct(MessageFactory $messageFactory)
22
    {
23 3
        $this->messageFactory = $messageFactory;
24 3
    }
25
26 1
    public function generate(): Layout
27
    {
28 1
        $mf = $this->messageFactory;
29
30 1
        return $mf->layout(
31 1
            $mf->blockSection(
32 1
                $mf->elementPlainText('Error: Something goes completely wrong!')
33
            )
34
        );
35
    }
36
}
37