HookDocumentAction::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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