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

DeleteElement   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDeletedElement() 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\ElementInterface;
11
12
/**
13
 * Class DeleteElement
14
 *
15
 * @package Nnx\FormComparator\Comparator\Diff
16
 */
17
class DeleteElement extends AbstractDiff
18
{
19
    /**
20
     * Удаленный элемент
21
     *
22
     * @var ElementInterface
23
     */
24
    private $deletedElement;
25
26
    /**
27
     * Возвращает удаленный элемент (есть в форме которую сравнивают, но отсутствует в форме с которой сравнивают)
28
     *
29
     * @return ElementInterface
30
     */
31
    public function getDeletedElement()
32
    {
33
        return $this->deletedElement;
34
    }
35
36
    /**
37
     * DeleteElement constructor.
38
     *
39
     * @param DiffBuilder $diffBuilder
40
     */
41
    public function __construct(DiffBuilder $diffBuilder)
42
    {
43
        $this->deletedElement = $diffBuilder->getSourceElement();
44
45
        parent::__construct($diffBuilder);
46
    }
47
}
48