SectionEntryDeleted   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 8
c 1
b 0
f 0
dl 0
loc 34
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getSuccess() 0 3 1
A getEntry() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the SexyField package.
5
 *
6
 * (c) Dion Snoeijen <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare (strict_types = 1);
13
14
namespace Tardigrades\SectionField\Event;
15
16
use Symfony\Component\EventDispatcher\Event;
17
use Tardigrades\SectionField\Generator\CommonSectionInterface;
18
19
/**
20
 * Class SectionEntryDeleted
21
 *
22
 * Right after the section entry entity is deleted from it's data sources, this event is dispatched.
23
 *
24
 * @package Tardigrades\SectionField\Event
25
 */
26
class SectionEntryDeleted extends Event
27
{
28
    const NAME = 'section.entry.deleted';
29
30
    /** @var  CommonSectionInterface */
31
    protected $entry;
32
33
    /** @var bool */
34
    protected $success;
35
36
    public function __construct(CommonSectionInterface $entry, bool $success)
37
    {
38
        $this->entry = $entry;
39
        $this->success = $success;
40
    }
41
42
    /**
43
     * This entry was deleted.
44
     *
45
     * @return CommonSectionInterface
46
     */
47
    public function getEntry(): CommonSectionInterface
48
    {
49
        return $this->entry;
50
    }
51
52
    /**
53
     * Has it been successful?
54
     *
55
     * @return bool
56
     */
57
    public function getSuccess(): bool
58
    {
59
        return $this->success;
60
    }
61
}
62