Controller::createStripeAccount()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 9
Ratio 100 %

Importance

Changes 0
Metric Value
dl 9
loc 9
c 0
b 0
f 0
rs 9.9666
cc 1
nc 1
nop 1
1
<?php
2
3
namespace App\Containers\Stripe\UI\API\Controllers;
4
5
use Apiato\Core\Foundation\Facades\Apiato;
6
use App\Containers\Stripe\UI\API\Requests\CreateStripeAccountRequest;
7
use App\Containers\Stripe\UI\API\Requests\UpdateStripeAccountRequest;
8
use App\Ship\Parents\Controllers\ApiController;
9
use App\Ship\Transporters\DataTransporter;
10
11
/**
12
 * Class Controller.
13
 *
14
 * @author Mahmoud Zalt <[email protected]>
15
 */
16
class Controller extends ApiController
17
{
18
19
    /**
20
     * @param \App\Containers\Stripe\UI\API\Requests\CreateStripeAccountRequest $request
21
     *
22
     * @return  \Illuminate\Http\JsonResponse
23
     */
24 View Code Duplication
    public function createStripeAccount(CreateStripeAccountRequest $request)
0 ignored issues
show
Duplication introduced by Mahmoud Zalt
This method 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...
25
    {
26
        $stripeAccount = Apiato::call('[email protected]', [new DataTransporter($request)]);
27
28
        return $this->accepted([
29
            'message'           => 'Stripe account created successfully.',
30
            'stripe_account_id' => $stripeAccount->id,
31
        ]);
32
    }
33
34
    /**
35
     * @param \App\Containers\Stripe\UI\API\Requests\UpdateStripeAccountRequest $request
36
     *
37
     * @return  \Illuminate\Http\JsonResponse
38
     */
39 View Code Duplication
    public function updateStripeAccount(UpdateStripeAccountRequest $request)
0 ignored issues
show
Duplication introduced by Johannes Schobel
This method 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...
40
    {
41
        $stripeAccount = Apiato::call('[email protected]', [new DataTransporter($request)]);
42
43
        return $this->accepted([
44
            'message'           => 'Stripe account updated successfully.',
45
            'stripe_account_id' => $stripeAccount->id,
46
        ]);
47
    }
48
49
}
50