Total Complexity | 3 |
Total Lines | 26 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
10 | class CandidateDeleter |
||
11 | { |
||
12 | public static function deleteCandidate(CandidateDeleteRequest $request, $candidateId) |
||
13 | { |
||
14 | $candidate = Candidate::findOrFail($candidateId); |
||
15 | |||
16 | $notificationEmailAddress = null; |
||
17 | if ($request->get('notify_candidate')) { |
||
|
|||
18 | $notificationEmailAddress = $candidate->email; |
||
19 | } |
||
20 | |||
21 | Storage::delete(storage_path('app/'.$candidate->path_to_cv)); |
||
22 | $candidate->path_to_cv = ''; |
||
23 | self::hashData($candidate); |
||
24 | $candidate->save(); |
||
25 | |||
26 | $candidate->delete(); //safe since we use softdeletes |
||
27 | |||
28 | event(new CandidateDeleted($candidate, $notificationEmailAddress)); |
||
29 | } |
||
30 | |||
31 | protected static function hashData(Candidate $candidate) |
||
36 | } |
||
37 | } |
||
38 |
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.