Explorar o código

Update Core\Validator for new Fork\__() function

Now an error array contains untranslated strings or template arrays.
Translation must be made in the output template iswev.
Visman %!s(int64=4) %!d(string=hai) anos
pai
achega
be429ea4c3
Modificáronse 1 ficheiros con 5 adicións e 4 borrados
  1. 5 4
      app/Core/Validator.php

+ 5 - 4
app/Core/Validator.php

@@ -371,7 +371,7 @@ class Validator
             list($type, $error) = $error;
             list($type, $error) = $error;
         }
         }
 
 
-        $this->errors[$type][] = __([$error, [':alias' => __($alias), ':attr' => $attr]]);
+        $this->errors[$type][] = [$error, [':alias' => __($alias), ':attr' => $attr]];
         $this->error           = true;
         $this->error           = true;
     }
     }
 
 
@@ -440,9 +440,10 @@ class Validator
     public function getErrorsWithoutType(): array
     public function getErrorsWithoutType(): array
     {
     {
         $result = [];
         $result = [];
-        \array_walk_recursive($this->errors, function ($item) use (&$result) {
-            $result[] = $item;
-        });
+
+        foreach ($this->errors as $errors) {
+            \array_push($result, ...$errors);
+        }
 
 
         return $result;
         return $result;
     }
     }