Total Complexity | 3 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
10 | trait FactoryAwareTrait |
||
11 | { |
||
12 | /** |
||
13 | * Validation factory instance. |
||
14 | * |
||
15 | * @var FactoryInterface |
||
16 | */ |
||
17 | protected $validationFactory; |
||
18 | |||
19 | /** |
||
20 | * Returns validation factory instance. |
||
21 | * |
||
22 | * @return FactoryInterface |
||
23 | */ |
||
24 | public function getValidationFactory() |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * Sets validation factory instance. |
||
31 | * |
||
32 | * @param FactoryInterface $factory |
||
33 | * |
||
34 | * @return $this |
||
35 | */ |
||
36 | public function setValidationFactory(FactoryInterface $factory) |
||
37 | { |
||
38 | $this->validationFactory = $factory; |
||
39 | |||
40 | return $this; |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * Builds validator using validation factory. |
||
45 | * |
||
46 | * @param array $data |
||
47 | * @param array $rules |
||
48 | * @param array $messages |
||
49 | * |
||
50 | * @return ValidatorInterface |
||
51 | */ |
||
52 | public function makeValidator(array $data, array $rules, array $messages = []) |
||
55 | } |
||
56 | } |
||
57 |