Total Complexity | 2 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Coverage | 60% |
Changes | 0 |
1 | <?php |
||
12 | abstract class Webhook implements \Slides\Connector\Auth\Contracts\Webhook |
||
13 | { |
||
14 | /** |
||
15 | * The request payload. |
||
16 | * |
||
17 | * @var array |
||
18 | */ |
||
19 | protected $payload; |
||
20 | |||
21 | /** |
||
22 | * Validator instance. |
||
23 | * |
||
24 | * @var \Illuminate\Validation\Validator |
||
25 | */ |
||
26 | protected $validator; |
||
27 | |||
28 | /** |
||
29 | * The payload validation rules. |
||
30 | * |
||
31 | * @return array |
||
32 | */ |
||
33 | protected abstract function rules(); |
||
34 | |||
35 | /** |
||
36 | * Validate a payload. |
||
37 | * |
||
38 | * @param array $payload |
||
39 | * |
||
40 | * @return bool |
||
41 | */ |
||
42 | 1 | public function validate(array $payload): bool |
|
47 | } |
||
48 | |||
49 | /** |
||
50 | * Get validator instance. |
||
51 | * |
||
52 | * @return \Illuminate\Validation\Validator |
||
53 | */ |
||
54 | public function getValidator(): \Illuminate\Validation\Validator |
||
57 | } |
||
58 | } |