Code Duplication    Length = 51-59 lines in 2 locations

app/Containers/Payment/UI/API/Controllers/Controller.php 1 location

@@ 20-70 (lines=51) @@
17
 * @author  Johannes Schobel <[email protected]>
18
 * @author  Mahmoud Zalt  <[email protected]>
19
 */
20
class Controller extends ApiController
21
{
22
23
    /**
24
     * @param GetAllPaymentAccountsRequest $request
25
     *
26
     * @return array
27
     */
28
    public function getAllPaymentAccounts(GetAllPaymentAccountsRequest $request)
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

app/Containers/Settings/UI/API/Controllers/Controller.php 1 location

@@ 19-77 (lines=59) @@
16
 *
17
 * @author  Mahmoud Zalt  <[email protected]>
18
 */
19
class Controller extends ApiController
20
{
21
22
    /**
23
     * Get All application settings
24
     *
25
     * @param GetAllSettingsRequest $request
26
     *
27
     * @return mixed
28
     */
29
    public function getAllSettings(GetAllSettingsRequest $request)
30
    {
31
        $settings = Apiato::call('[email protected]');
32
33
        return $this->transform($settings, SettingTransformer::class);
34
    }
35
36
    /**
37
     * create a new setting
38
     *
39
     * @param CreateSettingRequest $request
40
     *
41
     * @return mixed
42
     */
43
    public function createSetting(CreateSettingRequest $request)
44
    {
45
        $setting = Apiato::call('[email protected]', [new DataTransporter($request)]);
46
47
        return $this->transform($setting, SettingTransformer::class);
48
    }
49
50
    /**
51
     * Updates an existing setting
52
     *
53
     * @param UpdateSettingRequest $request
54
     *
55
     * @return mixed
56
     */
57
    public function updateSetting(UpdateSettingRequest $request)
58
    {
59
        $setting = Apiato::call('[email protected]', [new DataTransporter($request)]);
60
61
        return $this->transform($setting, SettingTransformer::class);
62
    }
63
64
    /**
65
     * Removes a setting
66
     *
67
     * @param DeleteSettingRequest $request
68
     *
69
     * @return \Illuminate\Http\JsonResponse
70
     */
71
    public function deleteSetting(DeleteSettingRequest $request)
72
    {
73
        Apiato::call('[email protected]', [new DataTransporter($request)]);
74
75
        return $this->noContent();
76
    }
77
}
78