Input::isValid()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace JhFlexiTime\InputFilter;
4
5
use Zend\InputFilter\Input as ZfBaseInput;
6
7
/**
8
 * Class Input
9
 * @package JhFlexiTime\InputFilter
10
 * @author Aydin Hassan <[email protected]>
11
 */
12
class Input extends ZfBaseInput
13
{
14
    /**
15
     * Overridden to set the context to use the filtered value
16
     * Eg - Dates will actually be DateTime instances
17
     *
18
     *
19
     * @param  mixed $context Extra "context" to provide the validator
20
     * @return bool
21
     */
22
    public function isValid($context = null)
23
    {
24
        //make the context use the filtered value
25
        $context[$this->getName()] =  $this->getValue();
26
        return parent::isValid($context);
27
    }
28
}
29