SlackAttachment   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Coupling/Cohesion

Components 3
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 71
c 0
b 0
f 0
wmc 3
lcom 3
cbo 0
ccs 10
cts 10
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A title() 0 7 1
A content() 0 6 1
A fields() 0 6 1
1
<?php
2
3
namespace Illuminate\Notifications\Messages;
4
5
class SlackAttachment
6
{
7
    /**
8
     * The attachment's title.
9
     *
10
     * @var string
11
     */
12
    public $title;
13
14
    /**
15
     * The attachment's URL.
16
     *
17
     * @var string
18
     */
19
    public $url;
20
21
    /**
22
     * The attachment's text content.
23
     *
24
     * @var string
25
     */
26
    public $content;
27
28
    /**
29
     * The attachment's fields.
30
     *
31
     * @var array
32
     */
33
    public $fields;
34
35
    /**
36
     * Set the title of the attachment.
37
     *
38
     * @param  string  $title
39
     * @param  string  $url
40
     * @return $this
41
     */
42 1
    public function title($title, $url = null)
43
    {
44 1
        $this->title = $title;
45 1
        $this->url = $url;
46
47 1
        return $this;
48
    }
49
50
    /**
51
     * Set the content (text) of the attachment.
52
     *
53
     * @param  string  $content
54
     * @return $this
55
     */
56 1
    public function content($content)
57
    {
58 1
        $this->content = $content;
59
60 1
        return $this;
61
    }
62
63
    /**
64
     * Set the fields of the attachment.
65
     *
66
     * @param  array  $fields
67
     * @return $this
68
     */
69 1
    public function fields(array $fields)
70
    {
71 1
        $this->fields = $fields;
72
73 1
        return $this;
74
    }
75
}
76