HookDocumentAction   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A notifyDocumentAction() 0 11 2
A __construct() 0 3 1
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