SubscriptionEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 7
c 2
b 0
f 0
dl 0
loc 38
ccs 4
cts 8
cp 0.5
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getSubscription() 0 3 1
A isFromRenew() 0 3 1
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