SubscriptionEvent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Terox\SubscriptionBundle\Event;
4
5
use Symfony\Component\EventDispatcher\Event;
6
use Terox\SubscriptionBundle\Model\SubscriptionInterface;
7
8
class SubscriptionEvent extends Event
0 ignored issues
show
Deprecated Code introduced by
The class Symfony\Component\EventDispatcher\Event has been deprecated: since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

8
class SubscriptionEvent extends /** @scrutinizer ignore-deprecated */ Event
Loading history...
9
{
10
    /**
11
     * @var SubscriptionInterface
12
     */
13
    private $subscription;
14
15
    /**
16
     * @var bool
17
     */
18
    private $fromRenew;
19
20
    /**
21
     * Constructor.
22
     *
23
     * @param SubscriptionInterface $subscription
24
     * @param boolean               $fromRenew
25
     */
26 9
    public function __construct(SubscriptionInterface $subscription, $fromRenew = false)
27
    {
28 9
        $this->subscription = $subscription;
29 9
        $this->fromRenew    = $fromRenew;
30 9
    }
31
32
    /**
33
     * @return SubscriptionInterface
34
     */
35
    public function getSubscription()
36
    {
37
        return $this->subscription;
38
    }
39
40
    /**
41
     * @return bool
42
     */
43
    public function isFromRenew()
44
    {
45
        return $this->fromRenew;
46
    }
47
}
48