Response::status()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace LeoCarmo\TelegramBot\Helpers;
4
5
class Response
6
{
7
8
    /**
9
     * @var string
10
     */
11
    private $status;
12
13
    /**
14
     * @var string
15
     */
16
    private $message;
17
18
    /**
19
     * Response constructor
20
     *
21
     * @param $message
22
     */
23
    private function __construct($message)
24
    {
25
        $this->message = $message;
26
    }
27
28
    /**
29
     * @param $message
30
     * @return Response
31
     */
32
    public static function message($message)
33
    {
34
        return new self($message);
35
    }
36
37
    /**
38
     * @param string $status
39
     * @return $this
40
     */
41
    public function status(string $status)
42
    {
43
        $this->status = $status;
44
        return $this;
45
    }
46
47
    /**
48
     * @return array
49
     */
50
    public function get()
51
    {
52
        return array_filter(get_object_vars($this));
53
    }
54
55
}