Completed
Pull Request — master (#93)
by Janis
04:18
created

StatusController::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
ccs 4
cts 4
cp 1
rs 10
c 1
b 0
f 0
cc 1
eloc 3
nc 1
nop 3
crap 1
1
<?php
2
3
/**
4
 * Nextcloud - OCR
5
 * This file is licensed under the Affero General Public License version 3 or
6
 * later. See the COPYING file.
7
 * 
8
 * @author Janis Koehr <[email protected]>
9
 * @copyright Janis Koehr 2017
10
 */
11
namespace OCA\Ocr\Controller;
12
13
use OCP\AppFramework\Controller;
14
use OCA\Ocr\Service\StatusService;
15
use OCP\IRequest;
16
17
18
class StatusController extends Controller {
19
20
    /**
21
     *
22
     * @var OcrService
23
     */
24
    private $service;
25
    use Errors;
26
27
    /**
28
     * StatusController constructor.
29
     * 
30
     * @param string $AppName            
31
     * @param IRequest $request            
32
     * @param StatusService $service            
33
     */
34 3
    public function __construct($AppName, IRequest $request, StatusService $service) {
35 3
        parent::__construct($AppName, $request);
36 3
        $this->service = $service;
0 ignored issues
show
Documentation Bug introduced by
It seems like $service of type object<OCA\Ocr\Service\StatusService> is incompatible with the declared type object<OCA\Ocr\Controller\OcrService> of property $service.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
37 3
    }
38
39
    /**
40
     * Get the current status.
41
     * @NoAdminRequired
42
     * 
43
     * @return DataResponse
44
     */
45
    public function getStatus() {
46 2
        return $this->handleNotFound(function () {
47 2
            return $this->service->getStatus();
48 2
        });
49
    }
50
}
51