Completed
Push — master ( fe8dc9...ddccce )
by Andrey
02:35
created

DeleteCollection   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 47
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getDeletedElement() 0 4 1
A getDeletedCollection() 0 4 1
A __construct() 0 6 1
1
<?php
2
/**
3
 * @link    https://github.com/nnx-framework/form-comparator
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace Nnx\FormComparator\Comparator\Diff;
7
8
use Nnx\FormComparator\Comparator\AbstractDiff;
9
use Nnx\FormComparator\Comparator\DiffBuilder;
10
use Zend\Form\Element\Collection;
11
12
/**
13
 * Class DeleteCollection
14
 *
15
 * @package Nnx\FormComparator\Comparator\Diff
16
 */
17
class DeleteCollection extends AbstractDiff
18
{
19
    /**
20
     * Удаленная коллекция
21
     *
22
     * @var Collection
23
     */
24
    private $deletedCollection;
25
26
    /**
27
     * Элементы удаленной коллекции
28
     *
29
     * @var DeleteElement[]
30
     */
31
    private $deletedElement = [];
32
33
    /**
34
     * Возвращает элементы удаленной коллекции
35
     *
36
     * @return DeleteElement[]
37
     */
38
    public function getDeletedElement()
39
    {
40
        return $this->deletedElement;
41
    }
42
    /**
43
     * Возвращает удаленную коллекцию
44
     *
45
     * @return Collection
46
     */
47
    public function getDeletedCollection()
48
    {
49
        return $this->deletedCollection;
50
    }
51
52
    /**
53
     * InsertElement constructor.
54
     *
55
     * @param DiffBuilder $diffBuilder
56
     */
57
    public function __construct(DiffBuilder $diffBuilder)
58
    {
59
        $this->deletedCollection = $diffBuilder->getTargetElement();
60
61
        parent::__construct($diffBuilder);
62
    }
63
}
64