Completed
Pull Request — master (#1984)
by Maciej
22:01
created

PreLoadEventArgs::getData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\ODM\MongoDB\Event;
6
7
use Doctrine\ODM\MongoDB\DocumentManager;
8
9
/**
10
 * Class that holds event arguments for a preLoad event.
11
 */
12
final class PreLoadEventArgs extends LifecycleEventArgs
13
{
14
    /** @var array */
15
    private $data;
16
17 18
    public function __construct(object $document, DocumentManager $dm, array &$data)
18
    {
19 18
        parent::__construct($document, $dm);
20 18
        $this->data =& $data;
21 18
    }
22
23
    /**
24
     * Get the array of data to be loaded and hydrated.
25
     */
26 2
    public function &getData() : array
27
    {
28 2
        return $this->data;
29
    }
30
}
31