AbstractDocumentEvent::getDebugMessage()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
rs 9.4286
cc 2
eloc 4
nc 1
nop 0
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