1 | <?php |
||
29 | class Index implements \JsonSerializable { |
||
30 | |||
31 | const INDEX_OK = 1; |
||
32 | const INDEX_IGNORE = 2; |
||
33 | |||
34 | const INDEX_META = 4; |
||
35 | const INDEX_CONTENT = 8; |
||
36 | const INDEX_FULL = 12; |
||
37 | const INDEX_REMOVE = 16; |
||
38 | |||
39 | const INDEX_DONE = 32; |
||
40 | const INDEX_FAILED = 64; |
||
41 | |||
42 | const ERROR_FAILED = 1; |
||
43 | const ERROR_FAILED2 = 2; |
||
44 | const ERROR_FAILED3 = 4; |
||
45 | |||
46 | |||
47 | /** @var string */ |
||
48 | private $providerId; |
||
49 | |||
50 | /** @var string */ |
||
51 | private $documentId; |
||
52 | |||
53 | /** @var string */ |
||
54 | private $ownerId = ''; |
||
55 | |||
56 | /** @var int */ |
||
57 | private $status = 0; |
||
58 | |||
59 | /** @var int */ |
||
60 | private $err = 0; |
||
61 | |||
62 | /** @var string */ |
||
63 | private $message; |
||
64 | |||
65 | /** @var int */ |
||
66 | private $lastIndex = 0; |
||
67 | |||
68 | |||
69 | public function __construct($providerId, $documentId) { |
||
73 | |||
74 | |||
75 | /** |
||
76 | * @return string |
||
77 | */ |
||
78 | public function getProviderId() { |
||
81 | |||
82 | /** |
||
83 | * @return string |
||
84 | */ |
||
85 | public function getDocumentId() { |
||
88 | |||
89 | |||
90 | /** |
||
91 | * @param string $ownerId |
||
92 | * |
||
93 | * @return $this |
||
94 | */ |
||
95 | public function setOwnerId($ownerId) { |
||
100 | |||
101 | /** |
||
102 | * @return string |
||
103 | */ |
||
104 | public function getOwnerId() { |
||
107 | |||
108 | |||
109 | /** |
||
110 | * @param int $status |
||
111 | * @param bool $reset |
||
112 | * |
||
113 | * @return $this |
||
114 | */ |
||
115 | public function setStatus($status, $reset = false) { |
||
124 | |||
125 | /** |
||
126 | * @return int |
||
127 | */ |
||
128 | public function getStatus() { |
||
131 | |||
132 | /** |
||
133 | * @param int $status |
||
134 | * |
||
135 | * @return bool |
||
|
|||
136 | */ |
||
137 | public function isStatus($status) { |
||
140 | |||
141 | /** |
||
142 | * @param int $status |
||
143 | */ |
||
144 | public function unsetStatus($status) { |
||
151 | |||
152 | |||
153 | /** |
||
154 | * @param int $err |
||
155 | * |
||
156 | * @return $this |
||
157 | */ |
||
158 | public function setError($err) { |
||
163 | |||
164 | /** |
||
165 | * @return int |
||
166 | */ |
||
167 | public function getError() { |
||
170 | |||
171 | /** |
||
172 | * @return $this |
||
173 | */ |
||
174 | public function incrementError() { |
||
179 | |||
180 | |||
181 | /** |
||
182 | * @return string |
||
183 | */ |
||
184 | public function getMessage() { |
||
187 | |||
188 | /** |
||
189 | * @param string $message |
||
190 | * |
||
191 | * @return Index |
||
192 | */ |
||
193 | public function setMessage($message) { |
||
198 | |||
199 | |||
200 | /** |
||
201 | * @param int $lastIndex |
||
202 | * |
||
203 | * @return $this |
||
204 | */ |
||
205 | public function setLastIndex($lastIndex = -1) { |
||
214 | |||
215 | /** |
||
216 | * @return int |
||
217 | */ |
||
218 | public function getLastIndex() { |
||
221 | |||
222 | |||
223 | /** |
||
224 | * @return array<string,string|integer> |
||
225 | */ |
||
226 | public function jsonSerialize() { |
||
235 | |||
236 | } |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.