| Total Complexity | 6 |
| Total Lines | 66 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class Filter |
||
| 14 | { |
||
| 15 | const INPUT_FILTER_FILTER = 'filter'; |
||
| 16 | const INPUT_FILTER_OPTIONS = 'options'; |
||
| 17 | const INPUT_FILTER_PROCESS = 'process'; |
||
| 18 | |||
| 19 | private $filterArgs; |
||
| 20 | private $data; |
||
| 21 | private $prepared; |
||
| 22 | private $result; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * __construct |
||
| 26 | * |
||
| 27 | * @param array $data |
||
| 28 | * @param array $filterArgs |
||
| 29 | */ |
||
| 30 | public function __construct(array $data, array $filterArgs) |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * process result filter |
||
| 39 | * |
||
| 40 | * @return Filter |
||
| 41 | */ |
||
| 42 | public function process(): Filter |
||
| 43 | { |
||
| 44 | $this->prepare(); |
||
| 45 | $this->result = \filter_var_array($this->data, $this->prepared); |
||
| 46 | return $this; |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * toArray |
||
| 51 | * |
||
| 52 | * @return array |
||
| 53 | */ |
||
| 54 | public function toArray() |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * prepare datas |
||
| 61 | * |
||
| 62 | * @return Filter |
||
| 63 | */ |
||
| 64 | protected function prepare(): Filter |
||
| 79 | } |
||
| 80 | } |
||
| 81 |