Completed
Push — master ( dfaf51...188ba1 )
by Samuel
02:15
created

ApiPresenter::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Kelemen\ApiNette\Presenter;
4
5
use Kelemen\ApiNette\Api;
6
use Nette\Application\UI\Presenter;
7
8
class ApiPresenter extends Presenter
9
{
10
    /** @var Api */
11
    private $api;
12
13
    /**
14
     * @param Api $api
15
     */
16 2
    public function __construct(Api $api)
17
    {
18 2
        parent::__construct();
19 2
        $this->api = $api;
20 2
    }
21
22
    /**
23
     * Run api handling
24
     * @param $params
25
     */
26 2
    public function actionDefault($params)
27
    {
28 2
        $response = $this->api->run($params);
29 2
        $this->sendResponse($response);
30
    }
31
}
32