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

Validation::getResultKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Kelemen\ApiNette\Validator;
4
5
class Validation
6
{
7
    /** @var string */
8
    private $type;
9
10
    /** @var string */
11
    private $key;
12
13
    /** @var string */
14
    private $rules;
15
16
    /** @var null|string */
17
    private $resultKey;
18
19
    /**
20
     * @param string $type
21
     * @param string $key
22
     * @param string $rules
23
     * @param null|string $resultKey
24
     */
25 12
    public function __construct($type, $key, $rules, $resultKey = null)
26
    {
27 12
        $this->type = $type;
28 12
        $this->key = $key;
29 12
        $this->rules = $rules;
30 12
        $this->resultKey = $resultKey !== null ? $resultKey : $key;
31 12
    }
32
33
    /**
34
     * @return string
35
     */
36 12
    public function getType()
37
    {
38 12
        return $this->type;
39
    }
40
41
    /**
42
     * @return string
43
     */
44 12
    public function getKey()
45
    {
46 12
        return $this->key;
47
    }
48
49
    /**
50
     * @return string
51
     */
52 12
    public function getRules()
53
    {
54 12
        return $this->rules;
55
    }
56
57
    /**
58
     * @return null|string
59
     */
60 8
    public function getResultKey()
61
    {
62 8
        return $this->resultKey;
63
    }
64
}
65