CreateStripeAccountRequest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 56
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 7 1
A authorize() 0 6 1
1
<?php
2
3
namespace App\Containers\Stripe\UI\API\Requests;
4
5
use App\Ship\Parents\Requests\Request;
6
7
/**
8
 * Class CreateStripeAccountRequest.
9
 *
10
 * @author Mahmoud Zalt <[email protected]>
11
 */
12
class CreateStripeAccountRequest extends Request
13
{
14
15
    /**
16
     * Define which Roles and/or Permissions has access to this request.
17
     *
18
     * @var  array
19
     */
20
    protected $access = [
21
        'permissions' => null
22
    ];
23
24
    /**
25
     * Id's that needs decoding before applying the validation rules.
26
     *
27
     * @var  array
28
     */
29
    protected $decode = [
30
31
    ];
32
33
    /**
34
     * Defining the URL parameters (`/stores/999/items`) allows applying
35
     * validation rules on them and allows accessing them like request data.
36
     *
37
     * @var  array
38
     */
39
    protected $urlParameters = [
40
41
    ];
42
43
    /**
44
     * Get the validation rules that apply to the request.
45
     *
46
     * @return array
47
     */
48
    public function rules()
49
    {
50
        return [
51
            'customer_id' => 'required|min:3',
52
            'card_id'     => 'required|min:3',
53
        ];
54
    }
55
56
    /**
57
     * Determine if the user is authorized to make this request.
58
     *
59
     * @return bool
60
     */
61
    public function authorize()
62
    {
63
        return $this->check([
64
            'hasAccess',
65
        ]);
66
    }
67
}
68