| Total Complexity | 5 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class NewsletterController extends Controller |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * Subscribe to the Newsletter |
||
| 17 | * |
||
| 18 | * @param Request $request The request object. |
||
| 19 | * |
||
| 20 | * @return RedirectResponse |
||
| 21 | */ |
||
| 22 | public function store(Request $request): RedirectResponse |
||
| 23 | { |
||
| 24 | $validator = NewsletterValidator::create($request->all()); |
||
| 25 | |||
| 26 | if ($validator->fails()) { |
||
| 27 | return redirect()->back() |
||
|
|
|||
| 28 | ->withErrors($validator) |
||
| 29 | ->withInput() |
||
| 30 | ->error('There are errors while subscribing to the Newsletter !'); |
||
| 31 | } |
||
| 32 | NewsletterRepository::create($request->all()); |
||
| 33 | |||
| 34 | return back() |
||
| 35 | ->success('You have successfully subscribed to our Newsletter !'); |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Unsubscribe to the Newsletter. |
||
| 40 | * |
||
| 41 | * @param string $email The email that should be used to unsubscribe to the Newsletter. |
||
| 42 | * |
||
| 43 | * @return RedirectResponse |
||
| 44 | */ |
||
| 45 | public function delete(string $email): RedirectResponse |
||
| 56 | } |
||
| 57 | } |
||
| 58 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.