Skip to content

Commit 0932289

Browse files
committed
fix return types
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent ad94c68 commit 0932289

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/Controller/LogController.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,16 @@ public function __construct($appName,
5353
* @param int $count
5454
* @param int $offset
5555
* @param string $levels
56-
* @return TemplateResponse
56+
* @return JSONResponse
5757
*/
58-
public function get($count = 50, $offset = 0, $levels = '11111') {
58+
public function get($count = 50, $offset = 0, $levels = '11111'): JSONResponse {
5959
$logType = $this->config->getSystemValue('log_type','file');
6060
if ($logType === 'file') { // we only support web access when `log_type` is set to `file` (the default)
6161
$iterator = $this->logIteratorFactory->getLogIterator($levels);
6262
return $this->responseFromIterator($iterator, $count, $offset);
6363
} else { // A log_type other than `file` seems to be configured so:
64-
// * Generate a dummy entry so we don't error out
65-
// * Use the dummy entry to inform the admin to look elsewhere and/or correct their configuration
64+
// * Generate a dummy entry so we don't error out
65+
// * Use the dummy entry to inform the admin to look elsewhere and/or correct their configuration
6666
$dummyLine["id"] = uniqid();
6767
$dummyLine["reqid"] = "00000000000000000000"; // irrelevant
6868
$dummyLine["level"] = 1; // INFO
@@ -156,11 +156,11 @@ public function poll(string $lastReqId, string $levels = '11111'): JSONResponse
156156
* @param int $count
157157
* @param int $offset
158158
* @param string $levels
159-
* @return TemplateResponse
159+
* @return JSONResponse
160160
*
161161
* @NoCSRFRequired
162162
*/
163-
public function search($query = '', $count = 50, $offset = 0, $levels = '11111') {
163+
public function search($query = '', $count = 50, $offset = 0, $levels = '11111'): JSONResponse {
164164
$iterator = $this->logIteratorFactory->getLogIterator($levels);
165165
$iterator = new \LimitIterator($iterator, 0, 100000); // limit the number of message we search to avoid huge search times
166166
$iterator->rewind();
@@ -221,7 +221,7 @@ public function setLevels(string $levels): int {
221221
return $minLevel;
222222
}
223223

224-
protected function responseFromIterator(\Iterator $iterator, $count, $offset) {
224+
protected function responseFromIterator(\Iterator $iterator, $count, $offset): JSONResponse {
225225
$iterator->rewind();
226226
for ($i = 0; $i < $offset; $i++) {
227227
$iterator->next();

0 commit comments

Comments
 (0)