PreLoadEventArgs   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 23
ccs 6
cts 6
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getData() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\SkeletonMapper\Event;
6
7
use Doctrine\SkeletonMapper\ObjectManagerInterface;
8
9
/**
10
 * Class that holds event arguments for a preLoad event.
11
 */
12
class PreLoadEventArgs extends LifecycleEventArgs
13
{
14
    /** @var mixed[] */
15
    private $data;
16
17
    /**
18
     * @param object  $object
19
     * @param mixed[] $data   Array of data to be loaded and hydrated
20
     */
21 18
    public function __construct($object, ObjectManagerInterface $objectManager, array &$data)
22
    {
23 18
        parent::__construct($object, $objectManager);
24 18
        $this->data = &$data;
25 18
    }
26
27
    /**
28
     * Get the array of data to be loaded and hydrated.
29
     *
30
     * @return mixed[]
31
     */
32 1
    public function &getData() : array
33
    {
34 1
        return $this->data;
35
    }
36
}
37