Completed
Pull Request — master (#264)
by Luc
27:18 queued 22:30
created

CopyEvent::getOriginalEventId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace CultuurNet\UDB3\Event\Commands;
4
5
use CultuurNet\UDB3\CalendarInterface;
6
use CultuurNet\UDB3\Offer\Commands\AbstractCommand;
7
8
class CopyEvent extends AbstractCommand
9
{
10
    /**
11
     * @var string
12
     */
13
    private $originalEventId;
14
15
    /**
16
     * @var CalendarInterface
17
     */
18
    private $calendar;
19
20
    /**
21
     * CopyEvent constructor.
22
     * @param string $eventId
23
     * @param string $originalEventId
24
     * @param CalendarInterface $calendar
25
     */
26 View Code Duplication
    public function __construct(
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
27
        $eventId,
28
        $originalEventId,
29
        CalendarInterface $calendar
30
    ) {
31
        parent::__construct($eventId);
32
33
        if (!is_string($originalEventId)) {
34
            throw new \InvalidArgumentException(
35
                'Expected originalEventId to be a string, received ' . gettype($originalEventId)
36
            );
37
        }
38
39
        $this->originalEventId = $originalEventId;
40
        $this->calendar = $calendar;
41
    }
42
43
    /**
44
     * @return string
45
     */
46
    public function getOriginalEventId()
47
    {
48
        return $this->originalEventId;
49
    }
50
51
    /**
52
     * @return CalendarInterface
53
     */
54
    public function getCalendar()
55
    {
56
        return $this->calendar;
57
    }
58
}
59