Post::setDescription()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
4
namespace databoxtech\multisocial;
5
6
7
class Post
8
{
9
    /**
10
     * @var string caption of the post
11
     */
12
    private $caption;
13
    /**
14
     * @var string description of the post
15
     */
16
    private $description;
17
    /**
18
     * @var Attachment[] array of attachments for the post
19
     */
20
    private $attachments;
21
    /**
22
     * @var string[] array of hash tags for the post
23
     */
24
    private $tags;
25
26
    /**
27
     * Post constructor.
28
     * @param string $caption
29
     * @param string $description
30
     * @param Attachment[] $attachments
31
     * @param string[] $tags
32
     */
33 12
    public function __construct(string $caption, string $description, array $attachments = [], array $tags = [])
34
    {
35 12
        $this->caption = $caption;
36 12
        $this->description = $description;
37 12
        $this->attachments = $attachments;
38 12
        $this->tags = $tags;
39 12
    }
40
41
    /**
42
     * @return string
43
     */
44 5
    public function getCaption(): string
45
    {
46 5
        return $this->caption;
47
    }
48
49
    /**
50
     * @param string $caption
51
     */
52 1
    public function setCaption(string $caption): void
53
    {
54 1
        $this->caption = $caption;
55 1
    }
56
57
    /**
58
     * @return string
59
     */
60 5
    public function getDescription(): string
61
    {
62 5
        return $this->description;
63
    }
64
65
    /**
66
     * @param string $description
67
     */
68 1
    public function setDescription(string $description): void
69
    {
70 1
        $this->description = $description;
71 1
    }
72
73
    /**
74
     * @return Attachment[]
75
     */
76 5
    public function getAttachments(): array
77
    {
78 5
        return $this->attachments;
79
    }
80
81
    /**
82
     * @param Attachment[] $attachments
83
     */
84 1
    public function setAttachments(array $attachments): void
85
    {
86 1
        $this->attachments = $attachments;
87 1
    }
88
89
    /**
90
     * @return string[]
91
     */
92 5
    public function getTags(): array
93
    {
94 5
        return $this->tags;
95
    }
96
97
    /**
98
     * @param string[] $tags
99
     */
100 1
    public function setTags(array $tags): void
101
    {
102 1
        $this->tags = $tags;
103 1
    }
104
105
106
107
108
}