10000 Fix overridden variable in error translator (#400) · Hy0320/laravel-json-api@1658607 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1658607

Browse files
rekrioslindyhopchris
authored andcommitted
Fix overridden variable in error translator (cloudcreativity#400)
1 parent 6f4f478 commit 1658607

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Validation/ErrorTranslator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,10 +416,10 @@ public function failedValidator(ValidatorContract $validator, \Closure $closure
416416
$failures = $this->createValidationFailures($failed[$key] ?? []);
417417

418418
foreach ($messages as $detail) {
419-
$failed = $failures->shift() ?: [];
420-
421419
if ($closure) {
422-
$errors->add($this->call($closure, $key, $detail, $failed));
420+
421+
$currentFailure = $failures->shift() ?: [];
422+
$errors->add($this->call($closure, $key, $detail, $currentFailure));
423423
continue;
424424
}
425425

0 commit comments

Comments
 (0)
0