1 | <?php |
||
28 | final class ResponseObject |
||
29 | { |
||
30 | |||
31 | /** |
||
32 | * Filesystem status |
||
33 | * |
||
34 | * All filesystem methods have true/false states which are stored here |
||
35 | * so it will only change when any messages are logged above minimum loglevel |
||
36 | * |
||
37 | * @var int $status |
||
38 | */ |
||
39 | private $status = false; |
||
40 | |||
41 | /** |
||
42 | * Last log code |
||
43 | * |
||
44 | * Last logged message code |
||
45 | * |
||
46 | * @var int $code |
||
47 | */ |
||
48 | private $code = 0; |
||
49 | |||
50 | /** |
||
51 | * Last log message |
||
52 | * |
||
53 | * Defaults to OK and further holds last logged message |
||
54 | * |
||
55 | * @var string $message |
||
56 | */ |
||
57 | private $message = 'OK'; |
||
58 | |||
59 | /** |
||
60 | * Following is optional to have user id and username attached to log |
||
61 | * Following can be anything you want for example your currently logged in |
||
62 | * user info or system user running the script. |
||
63 | * |
||
64 | * @var unknown |
||
65 | */ |
||
66 | private $UID = 0; |
||
67 | |||
68 | private $username = 'anonymous'; |
||
69 | |||
70 | private $context; |
||
71 | |||
72 | private $level; |
||
73 | |||
74 | |||
75 | 731 | public function setStatus($arg) |
|
79 | |||
80 | 731 | public function setCode($code) |
|
84 | |||
85 | 731 | public function setMsg($msg) |
|
89 | |||
90 | 731 | public function setUID($UID) |
|
94 | |||
95 | 731 | public function setUsername($username) |
|
99 | |||
100 | 731 | public function setTime() |
|
104 | |||
105 | 731 | public function setContext($context) |
|
109 | |||
110 | 731 | public function setLevel($level) |
|
114 | |||
115 | |||
116 | 33 | public function getStatus() |
|
120 | |||
121 | 84 | public function getCode() |
|
125 | |||
126 | 66 | public function getMsg() |
|
130 | |||
131 | 3 | public function getUID() |
|
135 | |||
136 | 3 | public function getUsername() |
|
140 | |||
141 | 63 | public function getTime() |
|
145 | |||
146 | 3 | public function getContext() |
|
150 | |||
151 | 3 | public function getLevel() |
|
155 | } |
||
156 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.