Completed
Pull Request — master (#1984)
by Maciej
19:41
created

PostCollectionLoadEventArgs   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 getCollection() 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
use Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface;
9
10
/**
11
 * Class that holds arguments for postCollectionLoad event.
12
 */
13
final class PostCollectionLoadEventArgs extends ManagerEventArgs
14
{
15
    /** @var PersistentCollectionInterface */
16
    private $collection;
17
18 178
    public function __construct(PersistentCollectionInterface $collection, DocumentManager $dm)
19
    {
20 178
        parent::__construct($dm);
21 178
        $this->collection = $collection;
22 178
    }
23
24
    /**
25
     * Gets collection that was just initialized (loaded).
26
     */
27 1
    public function getCollection() : PersistentCollectionInterface
28
    {
29 1
        return $this->collection;
30
    }
31
}
32