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

ApiPresenter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 87.5%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 24
ccs 7
cts 8
cp 0.875
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A actionDefault() 0 5 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