Controller::getAllPaymentAccounts()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 6
Ratio 100 %

Importance

Changes 0
Metric Value
dl 6
loc 6
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace App\Containers\Payment\UI\API\Controllers;
4
5
use Apiato\Core\Foundation\Facades\Apiato;
6
use App\Containers\Payment\UI\API\Requests\DeletePaymentAccountRequest;
7
use App\Containers\Payment\UI\API\Requests\FindPaymentAccountRequest;
8
use App\Containers\Payment\UI\API\Requests\GetAllPaymentAccountsRequest;
9
use App\Containers\Payment\UI\API\Requests\UpdatePaymentAccountRequest;
10
use App\Containers\Payment\UI\API\Transformers\PaymentAccountTransformer;
11
use App\Ship\Parents\Controllers\ApiController;
12
use App\Ship\Transporters\DataTransporter;
13
14
/**
15
 * Class Controller
16
 *
17
 * @author  Johannes Schobel <[email protected]glemail.com>
18
 * @author  Mahmoud Zalt  <[email protected]>
19
 */
20 View Code Duplication
class Controller extends ApiController
0 ignored issues
show
Duplication introduced by Johannes Schobel
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
21
{
22
23
    /**
24
     * @param GetAllPaymentAccountsRequest $request
25
     *
26
     * @return array
27
     */
28
    public function getAllPaymentAccounts(GetAllPaymentAccountsRequest $request)
0 ignored issues
show
Unused Code introduced by Mustafa Elkhalifa
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
29
    {
30
        $paymentAccounts = Apiato::call('[email protected]');
31
32
        return $this->transform($paymentAccounts, PaymentAccountTransformer::class);
33
    }
34
35
    /**
36
     * @param FindPaymentAccountRequest $request
37
     *
38
     * @return array
39
     */
40
    public function getPaymentAccount(FindPaymentAccountRequest $request)
41
    {
42
        $paymentAccount = Apiato::call('[email protected]', [new DataTransporter($request)]);
43
44
        return $this->transform($paymentAccount, PaymentAccountTransformer::class);
45
    }
46
47
    /**
48
     * @param UpdatePaymentAccountRequest $request
49
     *
50
     * @return array
51
     */
52
    public function updatePaymentAccount(UpdatePaymentAccountRequest $request)
53
    {
54
        $paymentAccount = Apiato::call('[email protected]', [new DataTransporter($request)]);
55
56
        return $this->transform($paymentAccount, PaymentAccountTransformer::class);
57
    }
58
59
    /**
60
     * @param DeletePaymentAccountRequest $request
61
     *
62
     * @return \Illuminate\Http\JsonResponse
63
     */
64
    public function deletePaymentAccount(DeletePaymentAccountRequest $request)
65
    {
66
        Apiato::call('[email protected]', [new DataTransporter($request)]);
67
68
        return $this->noContent();
69
    }
70
}
71