1 | <?php |
||||
2 | |||||
3 | namespace hiqdev\php\billing\charge\modifiers\event; |
||||
4 | |||||
5 | use hiqdev\php\billing\charge\ChargeInterface; |
||||
6 | use League\Event\AbstractEvent; |
||||
0 ignored issues
–
show
|
|||||
7 | |||||
8 | class LeasingWasFinished extends AbstractEvent implements \JsonSerializable |
||||
9 | { |
||||
10 | /** |
||||
11 | * @var ChargeInterface |
||||
12 | */ |
||||
13 | private $charge; |
||||
14 | /** |
||||
15 | * @var \DateTimeImmutable |
||||
16 | */ |
||||
17 | private $time; |
||||
18 | |||||
19 | private function __construct(ChargeInterface $charge, \DateTimeImmutable $time) |
||||
20 | { |
||||
21 | $this->charge = $charge; |
||||
22 | $this->time = $time; |
||||
23 | } |
||||
24 | |||||
25 | public static function onCharge(ChargeInterface $charge, \DateTimeImmutable $time): self |
||||
26 | { |
||||
27 | return new self($charge, $time); |
||||
28 | } |
||||
29 | |||||
30 | /** |
||||
31 | * @return ChargeInterface |
||||
32 | */ |
||||
33 | public function getCharge(): ChargeInterface |
||||
34 | { |
||||
35 | return $this->charge; |
||||
36 | } |
||||
37 | |||||
38 | /** |
||||
39 | * @return \DateTimeImmutable |
||||
40 | */ |
||||
41 | public function getTime(): \DateTimeImmutable |
||||
42 | { |
||||
43 | return $this->time; |
||||
44 | } |
||||
45 | |||||
46 | /** |
||||
47 | * Specify data which should be serialized to JSON |
||||
48 | * |
||||
49 | * @link https://php.net/manual/en/jsonserializable.jsonserialize.php |
||||
50 | * @return mixed data which can be serialized by <b>json_encode</b>, |
||||
51 | * which is a value of any type other than a resource. |
||||
52 | * @since 5.4.0 |
||||
53 | */ |
||||
54 | public function jsonSerialize() |
||||
55 | { |
||||
56 | return [ |
||||
57 | 'price_id' => $this->charge->getPrice()->getId(), |
||||
0 ignored issues
–
show
The method
getId() does not exist on hiqdev\php\billing\price\PriceInterface . Since it exists in all sub-types, consider adding an abstract or default implementation to hiqdev\php\billing\price\PriceInterface .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
58 | 'part_id' => $this->charge->getPrice()->getTarget()->getId(), |
||||
59 | ]; |
||||
60 | } |
||||
61 | } |
||||
62 |
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths