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

Validation   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 60
ccs 14
cts 14
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
A getType() 0 4 1
A getKey() 0 4 1
A getRules() 0 4 1
A getResultKey() 0 4 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