Passed
Push — 1.11.x ( 5ac02c...b5fc1e )
by Julito
12:15
created

HookDocumentItemAction::notifyDocumentItemAction()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 5
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 11
rs 10
1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
class HookDocumentItemAction extends HookEvent implements HookDocumentItemActionEventInterface
6
{
7
    protected function __construct()
8
    {
9
        parent::__construct('HookDocumentItemAction');
10
    }
11
12
    /**
13
     * Update all the observers.
14
     *
15
     * @param int $type
16
     *
17
     * @return array
18
     */
19
    public function notifyDocumentItemAction($type)
20
    {
21
        $this->eventData['type'] = $type;
22
23
        /** @var HookDocumentItemActionEventInterface $observer */
24
        foreach ($this->observers as $observer) {
25
            $data = $observer->notifyDocumentItemAction($this);
26
            $this->setEventData($data);
27
        }
28
29
        return $this->eventData;
30
    }
31
}
32