1 | <?php |
||
18 | trait Validable |
||
19 | { |
||
20 | /** |
||
21 | * Error message bag |
||
22 | * |
||
23 | * @var Illuminate\Support\MessageBag |
||
24 | */ |
||
25 | protected $errors; |
||
26 | /** |
||
27 | * Validator instance |
||
28 | * |
||
29 | * @var Illuminate\Validation\Factory |
||
30 | */ |
||
31 | protected $validator = null; |
||
32 | |||
33 | protected static function bootValidable() |
||
41 | |||
42 | public function setValidator(ValidatorFactory $validator) |
||
46 | |||
47 | public function hasValidator() |
||
51 | |||
52 | /** |
||
53 | * Validates current attributes against rules |
||
54 | */ |
||
55 | public function validate() |
||
70 | |||
71 | /** |
||
72 | * Set error message bag |
||
73 | * |
||
74 | * @var Illuminate\Support\MessageBag |
||
75 | */ |
||
76 | protected function setErrors($errors) |
||
80 | |||
81 | /** |
||
82 | * Retrieve error message bag |
||
83 | */ |
||
84 | public function getErrors() |
||
88 | |||
89 | /** |
||
90 | * Inverse of wasSaved |
||
91 | */ |
||
92 | public function hasErrors() |
||
96 | |||
97 | /** |
||
98 | * Return true if the validation is passed and the model was saved on db |
||
99 | * @return bool |
||
100 | */ |
||
101 | public function wasSaved() |
||
105 | |||
106 | |||
107 | public static function getRules() |
||
115 | |||
116 | public static function getCreatingRules() |
||
124 | |||
125 | protected static function replacePlaceholders(Model $model, $rules) |
||
139 | |||
140 | public static function getUpdatingRules(Model $model) |
||
154 | |||
155 | public static function getMessages() |
||
163 | } |
||
164 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..