AbstractDocumentEvent   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 6
Bugs 0 Features 2
Metric Value
c 6
b 0
f 2
dl 0
loc 34
wmc 4
lcom 1
cbo 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getDocument() 0 4 1
A getDebugMessage() 0 7 2
1
<?php
2
3
/*
4
 * This file is part of Sulu.
5
 *
6
 * (c) MASSIVE ART WebServices GmbH
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Sulu\Component\DocumentManager\Event;
13
14
abstract class AbstractDocumentEvent extends AbstractEvent
15
{
16
    /**
17
     * @var object
18
     */
19
    private $document;
20
21
    /**
22
     * @param object $document
23
     */
24
    public function __construct($document)
25
    {
26
        $this->document = $document;
27
    }
28
29
    /**
30
     * @return object
31
     */
32
    public function getDocument()
33
    {
34
        return $this->document;
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function getDebugMessage()
41
    {
42
        return sprintf(
43
            'd:%s',
44
            $this->document ? spl_object_hash($this->document) : '<no document>'
45
        );
46
    }
47
}
48