Passed
Push — master ( c2d3c3...2d4925 )
by Innocent
06:21
created

ContactController::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Faithgen\Miscellaneous\Http\Controllers;
4
5
use Faithgen\Miscellaneous\Http\Requests\ContactCreateRequest;
6
use Faithgen\Miscellaneous\Services\ContactService;
7
use Illuminate\Routing\Controller;
8
9
class ContactController extends Controller
10
{
11
    /**
12
     * @var ContactService
13
     */
14
    private ContactService $contactService;
15
16
    /**
17
     * ContactController constructor.
18
     *
19
     * @param  ContactService  $contactService
20
     */
21
    public function __construct(ContactService $contactService)
22
    {
23
        $this->contactService = $contactService;
24
    }
25
26
    /**
27
     * Creates a query for the given user.
28
     *
29
     * @param  ContactCreateRequest  $request
30
     *
31
     * @return \Illuminate\Http\JsonResponse
32
     */
33
    public function contact(ContactCreateRequest $request)
34
    {
35
        return $this->contactService->create($request->validated(),
36
            'Your query was received, thanks for making contact');
37
    }
38
}
39