Skip to content

Commit

Permalink
Fix exception throwing on older PHP versions (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints authored Jan 25, 2022
1 parent 37ecef8 commit 671c552
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
12 changes: 7 additions & 5 deletions stubs/api/App/Http/Controllers/Auth/NewPasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ function ($user) use ($request) {
}
);

return $status == Password::PASSWORD_RESET
? response()->json(['status' => __($status)])
: throw ValidationException::withMessages([
'email' => [__($status)],
]);
if ($status != Password::PASSWORD_RESET) {
throw ValidationException::withMessages([
'email' => [__($status)],
]);
}

return response()->json(['status' => __($status)]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ public function store(Request $request)
$request->only('email')
);

return $status == Password::RESET_LINK_SENT
? response()->json(['status' => __($status)])
: throw ValidationException::withMessages([
'email' => [__($status)],
]);
if ($status != Password::RESET_LINK_SENT) {
throw ValidationException::withMessages([
'email' => [__($status)],
]);
}

return response()->json(['status' => __($status)]);
}
}

0 comments on commit 671c552

Please sign in to comment.