MandateEventHandlerJob::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace GoCardlessPayment\Jobs\WebhookHandlers;
4
5
use GoCardlessPayment\Actions\Imports\ImportMandateAction;
6
use GoCardlessPayment\Events\GoCardlessWebhookEventHandled;
7
8
/**
9
 * General handler for all mandate related events.
10
 */
11
class MandateEventHandlerJob extends WebhookEventHandlerJob
12
{
13 3
    public function handle(): void
14
    {
15 3
        $mandateId = $this->event->links->mandate;
16
17 3
        $model = ImportMandateAction::make($mandateId)->execute();
18
19 2
        GoCardlessWebhookEventHandled::dispatch($this->event, $model);
20
    }
21
}
22