File tree Expand file tree Collapse file tree 1 file changed +1
-24
lines changed
Expand file tree Collapse file tree 1 file changed +1
-24
lines changed Original file line number Diff line number Diff line change @@ -27,31 +27,8 @@ public function addError($role, $customMessages)
2727 $ message = $ this ->replacePlaceholders ($ placeholders , $ role ->message ());
2828 }
2929
30- $ nestedKeys = explode ( ' . ' , $ attributeKey ) ;
30+ $ this -> errors [ $ attributeKey ][] = $ message ;
3131
32- if (is_array ($ nestedKeys )) {
33- $ this ->generateNestedError ($ nestedKeys , $ message );
34- } else {
35- $ this ->errors [$ attributeKey ][] = $ message ;
36- }
37-
38- }
39-
40- private function generateNestedError ($ keys , $ message )
41- {
42- $ errors = &$ this ->errors ;
43-
44- while ($ keys ) {
45- $ key = array_shift ($ keys );
46-
47- if (isset ($ current [$ key ]) && !is_array ($ current [$ key ])) {
48- $ errors [$ key ] = [];
49- }
50-
51- $ errors = &$ errors [$ key ];
52- }
53-
54- $ errors = $ message ;
5532 }
5633
5734 private function replacePlaceholders ($ placeholders , $ message )
You can’t perform that action at this time.
0 commit comments