Completed
Push — master ( 3830bc...2c9d17 )
by Samuel
02:31
created

BaseHandler::setValidatedValues()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Kelemen\ApiNette\Handler;
4
5
use Nette\Application\IResponse;
6
use Nette\Http\Request;
7
use Nette\Http\Response;
8
9
abstract class BaseHandler
10
{
11
    /** @var array      Values validated by validator. Doesn't contains all input values! */
12
    protected $values;
13
14
    /**
15
     * @param array $values
16
     */
17 4
    public function setValidatedValues(array $values)
18
    {
19 4
        $this->values = $values;
20 4
    }
21
22
    /**
23
     * Validate input
24
     * @return array
25
     */
26 4
    public function validate()
27
    {
28 4
        return [];
29
    }
30
31
    /**
32
     * @param Request $request
33
     * @param Response $response
34
     * @param callable $next
35
     * @return IResponse
36
     */
37
    abstract public function __invoke(Request $request, Response $response, callable $next);
38
}
39