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

PreLoadEventArgs   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 19
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getData() 0 4 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