Passed
Push — trunk ( b25d7b...3c7131 )
by Christian
11:39 queued 13s
created

RecurringDataStruct   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 20
rs 10
c 1
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getSubscriptionId() 0 3 1
A __construct() 0 4 1
A getNextSchedule() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Core\Checkout\Payment\Cart\Recurring;
4
5
use Shopware\Core\Framework\Log\Package;
6
use Shopware\Core\Framework\Struct\Struct;
7
8
/**
9
 * @experimental This is an experimental payment struct to make generic subscription informations available without relying as an payment handler to a specific subscription extensions
10
 */
11
#[Package('checkout')]
12
class RecurringDataStruct extends Struct
13
{
14
    /**
15
     * @internal
16
     */
17
    public function __construct(
18
        protected string $subscriptionId,
19
        protected \DateTimeInterface $nextSchedule,
20
    ) {
21
    }
22
23
    public function getSubscriptionId(): string
24
    {
25
        return $this->subscriptionId;
26
    }
27
28
    public function getNextSchedule(): \DateTimeInterface
29
    {
30
        return $this->nextSchedule;
31
    }
32
}
33