1 | <?php |
||||||
2 | |||||||
3 | namespace App\Http\Controllers; |
||||||
4 | |||||||
5 | use App\Models\Candidate; |
||||||
6 | use App\Models\Message; |
||||||
7 | use App\Models\PredefinedMessage; |
||||||
8 | use App\Models\StageMessageTemplate; |
||||||
9 | use App\Services\MessagesService; |
||||||
0 ignored issues
–
show
|
|||||||
10 | use App\Services\UtilsService; |
||||||
0 ignored issues
–
show
The type
App\Services\UtilsService was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||||
11 | use Illuminate\Http\Request; |
||||||
12 | |||||||
13 | class MessagesController extends Controller |
||||||
14 | { |
||||||
15 | public function list(Request $request) |
||||||
16 | { |
||||||
17 | $candidateId = $request->get('candidate_id'); |
||||||
0 ignored issues
–
show
The method
get() does not exist on Illuminate\Http\Request .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
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. ![]() |
|||||||
18 | |||||||
19 | if ($candidateId) { |
||||||
20 | $messages = Message::where('candidate_id', $candidateId)->orderBy('created_at', 'ASC')->get(); |
||||||
21 | } else { |
||||||
22 | $messages = Message::orderBy('id', 'ASC')->get(); |
||||||
23 | } |
||||||
24 | |||||||
25 | return response()->json($messages); |
||||||
26 | } |
||||||
27 | |||||||
28 | public function templateParsedAjax(Request $request) |
||||||
29 | { |
||||||
30 | $candidate = Candidate::find($request->candidate_id); |
||||||
0 ignored issues
–
show
|
|||||||
31 | |||||||
32 | $hashSuffix = UtilsService::hashSuffix($request->candidate_id); |
||||||
33 | |||||||
34 | $messageTemplate = PredefinedMessage::where('recruitment_id', $candidate->recruitment_id)->where('stage_id', $request->stage_id)->first(); |
||||||
0 ignored issues
–
show
|
|||||||
35 | |||||||
36 | if (!$messageTemplate) { |
||||||
37 | $messageTemplate = StageMessageTemplate::where('stage_id', $request->stage_id)->first(); |
||||||
38 | } |
||||||
39 | |||||||
40 | if (!$messageTemplate) { |
||||||
41 | return response()->json([ |
||||||
42 | 'subject' => $hashSuffix, |
||||||
43 | 'body' => '', |
||||||
44 | ]); |
||||||
45 | } |
||||||
46 | |||||||
47 | MessagesService::parseTemplate($messageTemplate, $candidate); |
||||||
48 | |||||||
49 | return response()->json([ |
||||||
50 | 'subject' => "$messageTemplate->subject $hashSuffix", |
||||||
51 | 'body' => $messageTemplate->body, |
||||||
52 | ]); |
||||||
53 | } |
||||||
54 | |||||||
55 | public function update(Request $request, $id) |
||||||
56 | { |
||||||
57 | $messageTemplate = PredefinedMessage::find($id); |
||||||
58 | $messageTemplate->update($request->all()); |
||||||
0 ignored issues
–
show
The method
all() does not exist on Illuminate\Http\Request .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
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. ![]() |
|||||||
59 | |||||||
60 | return 'OK'; |
||||||
61 | } |
||||||
62 | } |
||||||
63 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths