Completed
Push — master ( fc4ead...c5d222 )
by Andrii
05:51
created

LeasingWasFinished   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 36
ccs 0
cts 12
cp 0
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getPrice() 0 3 1
A getDate() 0 3 1
A forPriceInMonth() 0 3 1
1
<?php
2
3
namespace hiqdev\php\billing\charge\modifiers\event;
4
5
use hiqdev\php\billing\price\PriceInterface;
6
use League\Event\AbstractEvent;
0 ignored issues
show
Bug introduced by
The type League\Event\AbstractEvent was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
8
class LeasingWasFinished extends AbstractEvent
9
{
10
    /**
11
     * @var PriceInterface
12
     */
13
    private $price;
14
    /**
15
     * @var \DateTimeImmutable
16
     */
17
    private $date;
18
19
    private function __construct(PriceInterface $price, \DateTimeImmutable $date)
20
    {
21
        $this->price = $price;
22
        $this->date = $date;
23
    }
24
25
    public static function forPriceInMonth(PriceInterface $price, \DateTimeImmutable $date): self
26
    {
27
        return new self($price, $date);
28
    }
29
30
    /**
31
     * @return PriceInterface
32
     */
33
    public function getPrice(): PriceInterface
34
    {
35
        return $this->price;
36
    }
37
38
    /**
39
     * @return \DateTimeImmutable
40
     */
41
    public function getDate(): \DateTimeImmutable
42
    {
43
        return $this->date;
44
    }
45
}
46