Total Complexity | 8 |
Total Lines | 99 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 10 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
5 | class FacebookPosterPost |
||
6 | { |
||
7 | /** |
||
8 | * The post message. |
||
9 | * |
||
10 | * @var string |
||
11 | */ |
||
12 | protected $message; |
||
13 | |||
14 | /** |
||
15 | * The post link. |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $link; |
||
20 | |||
21 | /** |
||
22 | * Additional post parameters. |
||
23 | * |
||
24 | * @var array |
||
25 | */ |
||
26 | protected array $params = []; |
||
27 | |||
28 | /** |
||
29 | * Create a new post instance. |
||
30 | * |
||
31 | * @param string $message |
||
32 | * @return void |
||
33 | */ |
||
34 | public function __construct($message) |
||
35 | { |
||
36 | $this->message = $message; |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * Set the post message. |
||
41 | */ |
||
42 | public function withMessage(?string $message) |
||
43 | { |
||
44 | $this->message = $message; |
||
45 | |||
46 | return $this; |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * Get the post message. |
||
51 | */ |
||
52 | public function getMessage(): ?string |
||
53 | 6 | { |
|
54 | return $this->message; |
||
55 | 6 | } |
|
56 | 6 | ||
57 | /** |
||
58 | * Set ths post link. |
||
59 | */ |
||
60 | public function withLink(?string $link) |
||
61 | { |
||
62 | $this->link = $link; |
||
63 | 6 | ||
64 | return $this; |
||
65 | 6 | } |
|
66 | |||
67 | /** |
||
68 | * Get the post link. |
||
69 | */ |
||
70 | public function getLink(): ?string |
||
71 | { |
||
72 | return $this->link; |
||
73 | } |
||
74 | |||
75 | 1 | /** |
|
76 | * Set the post params. |
||
77 | 1 | */ |
|
78 | public function withParams(array $params) |
||
83 | } |
||
84 | |||
85 | /** |
||
86 | * Get the post params. |
||
87 | */ |
||
88 | public function getParams(): array |
||
89 | 1 | { |
|
90 | return $this->params; |
||
91 | 1 | } |
|
92 | 1 | ||
93 | /** |
||
94 | 1 | * Get the filtered body. |
|
95 | */ |
||
96 | public function getBody(): array |
||
104 | } |
||
105 | } |
||
106 |