Completed
Push — master ( ebee1b...83e9b5 )
by Samuel
02:50
created

BaseHandler::setValidatedValues()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
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
    private $values;
13
14
    /**
15
     * @param array $values
16
     */
17
    public function setValidatedValues(array $values)
18
    {
19
        $this->values = $values;
20
    }
21
22
    /**
23
     * Validate input
24
     * @return bool
25
     */
26
    abstract public function validate();
27
28
    /**
29
     * @param Request $request
30
     * @param Response $response
31
     * @param callable $next
32
     * @return IResponse
33
     */
34
    abstract public function __invoke(Request $request, Response $response, callable $next);
35
}
36