Total Complexity | 5 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class SourcesController extends Controller |
||
13 | { |
||
14 | /** |
||
15 | * Create a new controller instance. |
||
16 | * |
||
17 | * @param TenantManager $tenantManager |
||
18 | * |
||
19 | * @return void |
||
20 | */ |
||
21 | public function __construct(TenantManager $tenantManager) |
||
22 | { |
||
23 | SourceResource::setTenantManager($tenantManager); //workaround - not the best but it works well |
||
24 | } |
||
25 | |||
26 | public function list(Request $request) |
||
27 | { |
||
28 | $recruitmentId = $request->get('recruitment_id'); |
||
|
|||
29 | |||
30 | if ($recruitmentId) { |
||
31 | $sources = Source::where('recruitment_id', $recruitmentId)->orderBy('created_at', 'DESC')->get(); |
||
32 | } else { |
||
33 | $sources = Source::orderBy('created_at', 'DESC')->get(); |
||
34 | } |
||
35 | |||
36 | return SourceResource::collection($sources); |
||
37 | } |
||
38 | |||
39 | public function create(SourceCreateRequest $request) |
||
44 | } |
||
45 | |||
46 | public function delete($sourceId) |
||
53 |
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.