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

AbstractValidator::setHaystack()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 9.4285
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