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

HookDocumentAction   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 25
rs 10
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
class HookDocumentAction extends HookEvent implements HookDocumentActionEventInterface
6
{
7
    protected function __construct()
8
    {
9
        parent::__construct('HookDocumentAction');
10
    }
11
12
    /**
13
     * Update all the observers.
14
     *
15
     * @param int $type
16
     *
17
     * @return array
18
     */
19
    public function notifyDocumentAction($type)
20
    {
21
        $this->eventData['type'] = $type;
22
23
        /** @var HookDocumentActionEventInterface $observer */
24
        foreach ($this->observers as $observer) {
25
            $data = $observer->notifyDocumentAction($this);
26
            $this->setEventData($data);
27
        }
28
29
        return $this->eventData;
30
    }
31
}
32