Completed
Push — master ( 188ba1...86d637 )
by Samuel
02:55
created

Validation   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 85.71%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 38
ccs 12
cts 14
cp 0.8571
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
    private $type;
8
9
    private $key;
10
11
    private $rules;
12
13
    private $resultKey;
14
15 12
    public function __construct($type, $key, $rules, $resultKey = null)
16
    {
17 12
        $this->type = $type;
18 12
        $this->key = $key;
19 12
        $this->rules = $rules;
20 12
        $this->resultKey = $resultKey !== null ? $resultKey : $key;
21 12
    }
22
23 12
    public function getType()
24
    {
25 12
        return $this->type;
26
    }
27
28 12
    public function getKey()
29
    {
30 12
        return $this->key;
31
    }
32
33 12
    public function getRules()
34
    {
35 12
        return $this->rules;
36
    }
37
38
    public function getResultKey()
39
    {
40
        return $this->resultKey;
41
    }
42
}
43