SendgridApiService::bindHook()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Swm\Bundle\MailHookBundle\ApiService;
4
5
use Swm\Bundle\MailHookBundle\Hook\DefaultHook;
6
7
class SendgridApiService extends BaseApiService
8
{
9
    /**
10
     * @param  array  $hook
11
     * @return HookInterface
12
     */
13
    private function bindHook(array $hook)
14
    {
15
        return new DefaultHook($hook['event'], $hook['email'], 'sendgrid', $hook);
0 ignored issues
show
Bug introduced by
The call to DefaultHook::__construct() misses a required argument $eventDispatched.

This check looks for function calls that miss required arguments.

Loading history...
16
    }
17
18
    /**
19
     * @return array<HookInterface>
20
     */
21
    public function bind()
22
    {
23
        $metaData = json_decode($this->request->getContent(), true);
24
25
        return array_map(array($this, 'bindHook'), $metaData);
26
    }
27
}
28