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 int */ |
||
63 | private $lastIndex = 0; |
||
64 | |||
65 | |||
66 | public function __construct($providerId, $documentId) { |
||
70 | |||
71 | |||
72 | /** |
||
73 | * @return string |
||
74 | */ |
||
75 | public function getProviderId() { |
||
78 | |||
79 | /** |
||
80 | * @return string |
||
81 | */ |
||
82 | public function getDocumentId() { |
||
85 | |||
86 | |||
87 | /** |
||
88 | * @param string $ownerId |
||
89 | * |
||
90 | * @return $this |
||
91 | */ |
||
92 | public function setOwnerId($ownerId) { |
||
97 | |||
98 | /** |
||
99 | * @return string |
||
100 | */ |
||
101 | public function getOwnerId() { |
||
104 | |||
105 | |||
106 | /** |
||
107 | * @param int $status |
||
108 | * @param bool $reset |
||
109 | * |
||
110 | * @return $this |
||
111 | */ |
||
112 | public function setStatus($status, $reset = false) { |
||
121 | |||
122 | /** |
||
123 | * @return int |
||
124 | */ |
||
125 | public function getStatus() { |
||
128 | |||
129 | /** |
||
130 | * @param int $status |
||
131 | * |
||
132 | * @return bool |
||
|
|||
133 | */ |
||
134 | public function isStatus($status) { |
||
137 | |||
138 | /** |
||
139 | * @param int $status |
||
140 | */ |
||
141 | public function unsetStatus($status) { |
||
148 | |||
149 | /** |
||
150 | * @param int $err |
||
151 | * |
||
152 | * @return $this |
||
153 | */ |
||
154 | public function setError($err) { |
||
159 | |||
160 | /** |
||
161 | * @return int |
||
162 | */ |
||
163 | public function getError() { |
||
166 | |||
167 | |||
168 | /** |
||
169 | * @param int $lastIndex |
||
170 | * |
||
171 | * @return $this |
||
172 | */ |
||
173 | public function setLastIndex($lastIndex = -1) { |
||
182 | |||
183 | /** |
||
184 | * @return int |
||
185 | */ |
||
186 | public function getLastIndex() { |
||
189 | |||
190 | |||
191 | /** |
||
192 | * @return array<string,string|integer> |
||
193 | */ |
||
194 | public function jsonSerialize() { |
||
203 | |||
204 | } |
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.