| Total Complexity | 5 |
| Total Lines | 60 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | class ToYearFilter implements FilterInterface |
||
| 19 | { |
||
| 20 | const FILTER_NAME = 'search[filter_float_year:to]'; |
||
| 21 | const FILTER_DESC = 'TO year of production'; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var string |
||
| 25 | */ |
||
| 26 | private $value; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var FilterValidatorInterface |
||
| 30 | */ |
||
| 31 | private $validator; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * ToYearFilter constructor. |
||
| 35 | * @param FilterValidatorInterface $validator |
||
| 36 | * @param string $value |
||
| 37 | * @throws IncorrectFilterValueException |
||
| 38 | */ |
||
| 39 | 4 | public function __construct(FilterValidatorInterface $validator, string $value) |
|
| 40 | { |
||
| 41 | 4 | $this->validator = $validator; |
|
| 42 | 4 | $this->setValue($value); |
|
| 43 | 4 | } |
|
| 44 | |||
| 45 | /** |
||
| 46 | * @return string |
||
| 47 | */ |
||
| 48 | 1 | public function getName(): string |
|
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @return string |
||
| 55 | */ |
||
| 56 | 1 | public function getDescription(): string |
|
| 57 | { |
||
| 58 | 1 | return self::FILTER_DESC; |
|
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @return string |
||
| 63 | */ |
||
| 64 | 1 | public function getValue(): string |
|
| 67 | } |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @param string $value |
||
| 71 | * @return void |
||
| 72 | * @throws IncorrectFilterValueException |
||
| 73 | */ |
||
| 74 | 4 | public function setValue(string $value): void |
|
| 78 | 4 | } |
|
| 79 | } |
||
| 80 |