Passed
Push — master ( 80e0c9...dc1096 )
by Jonathan
01:53
created

AbstractValidator::getHaystack()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Tisd\Sdk\Validator;
4
5
class AbstractValidator
6
{
7
    protected $haystack;
8
9 4
    public function isValid($value)
10
    {
11 4
        return in_array($value, $this->getHaystack());
12
    }
13
14 4
    protected function getHaystack()
15
    {
16 4
        return $this->haystack;
17
    }
18
19 4
    protected function setHaystack($haystack)
20
    {
21 4
        $this->haystack = $haystack;
22
23 4
        return $this;
24
    }
25
}
26