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() |
||
43 | |||
44 | public function setValidator(ValidatorFactory $validator) |
||
48 | |||
49 | public function hasValidator() |
||
53 | |||
54 | /** |
||
55 | * Validates current attributes against rules |
||
56 | */ |
||
57 | public function validate() |
||
68 | |||
69 | /** |
||
70 | * Set error message bag |
||
71 | * |
||
72 | * @var Illuminate\Support\MessageBag |
||
73 | */ |
||
74 | protected function setErrors($errors) |
||
78 | |||
79 | /** |
||
80 | * Retrieve error message bag |
||
81 | */ |
||
82 | public function getErrors() |
||
86 | |||
87 | /** |
||
88 | * Inverse of wasSaved |
||
89 | */ |
||
90 | public function hasErrors() |
||
94 | |||
95 | /** |
||
96 | * Return true if the validation is passed and the model was saved on db |
||
97 | * @return bool |
||
98 | */ |
||
99 | public function wasSaved() |
||
103 | |||
104 | |||
105 | public static function getRules() |
||
113 | |||
114 | public static function getCreatingRules() |
||
122 | |||
123 | protected static function replacePlaceholders(Model $model, $rules) |
||
135 | |||
136 | public static function getUpdatingRules(Model $model) |
||
150 | |||
151 | public static function getMessages() |
||
159 | } |
||
160 |
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..