Completed
Pull Request — master (#575)
by
unknown
02:19
created

ImportSingleIcalEvent::stop()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace HDNET\Calendarize\Event;
6
7
use HDNET\Calendarize\Ical\ICalEvent;
8
use Psr\EventDispatcher\StoppableEventInterface;
9
10
final class ImportSingleIcalEvent implements StoppableEventInterface
11
{
12
    /**
13
     * @var ICalEvent
14
     */
15
    private $event;
16
17
    /**
18
     * @var int
19
     */
20
    private $pid;
21
22
    /**
23
     * @var bool
24
     */
25
    private $stopped = false;
26
27
    /**
28
     * ImportSingleEvent constructor.
29
     *
30
     * @param ICalEvent $event
31
     * @param int       $pid
32
     */
33
    public function __construct(ICalEvent $event, int $pid)
34
    {
35
        $this->event = $event;
36
        $this->pid = $pid;
37
    }
38
39
    /**
40
     * @return ICalEvent
41
     */
42
    public function getEvent(): ICalEvent
43
    {
44
        return $this->event;
45
    }
46
47
    /**
48
     * @return int
49
     */
50
    public function getPid(): int
51
    {
52
        return $this->pid;
53
    }
54
55
    public function stop(): void
56
    {
57
        $this->stopped = true;
58
    }
59
60
    public function isPropagationStopped(): bool
61
    {
62
        return $this->stopped;
63
    }
64
}
65