Passed
Push — main ( a589bb...03f306 )
by Iain
05:35
created

EntityFactory   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
dl 0
loc 40
rs 10
c 1
b 0
f 0
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getPaymentEntity() 0 3 1
A getPriceEntity() 0 3 1
A getSubscriptionEntity() 0 3 1
A getSubscriptionPlanEntity() 0 3 1
A getChargeBackEntity() 0 3 1
A getReceiptLine() 0 3 1
A getReceipt() 0 3 1
A getProductEntity() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * Copyright Humbly Arrogant Software Limited 2020-2023.
7
 *
8
 * Use of this software is governed by the Business Source License included in the LICENSE file and at https://getparthenon.com/docs/next/license.
9
 *
10
 * Change Date: 26.06.2026 ( 3 years after 2.2.0 release )
11
 *
12
 * On the date above, in accordance with the Business Source License, use of this software will be governed by the open source license specified in the LICENSE file.
13
 */
14
15
namespace Parthenon\Billing\Factory;
16
17
use Parthenon\Billing\Entity\ChargeBack;
18
use Parthenon\Billing\Entity\Payment;
19
use Parthenon\Billing\Entity\Price;
20
use Parthenon\Billing\Entity\PriceInterface;
21
use Parthenon\Billing\Entity\Product;
22
use Parthenon\Billing\Entity\ProductInterface;
23
use Parthenon\Billing\Entity\Receipt;
24
use Parthenon\Billing\Entity\ReceiptInterface;
25
use Parthenon\Billing\Entity\ReceiptLine;
26
use Parthenon\Billing\Entity\ReceiptLineInterface;
27
use Parthenon\Billing\Entity\Subscription;
28
use Parthenon\Billing\Entity\SubscriptionPlan;
29
use Parthenon\Billing\Entity\SubscriptionPlanInterface;
30
31
class EntityFactory implements EntityFactoryInterface
32
{
33
    public function getSubscriptionEntity(): Subscription
34
    {
35
        return new Subscription();
36
    }
37
38
    public function getPaymentEntity(): Payment
39
    {
40
        return new Payment();
41
    }
42
43
    public function getChargeBackEntity(): ChargeBack
44
    {
45
        return new ChargeBack();
46
    }
47
48
    public function getProductEntity(): ProductInterface
49
    {
50
        return new Product();
51
    }
52
53
    public function getPriceEntity(): PriceInterface
54
    {
55
        return new Price();
56
    }
57
58
    public function getSubscriptionPlanEntity(): SubscriptionPlanInterface
59
    {
60
        return new SubscriptionPlan();
61
    }
62
63
    public function getReceipt(): ReceiptInterface
64
    {
65
        return new Receipt();
66
    }
67
68
    public function getReceiptLine(): ReceiptLineInterface
69
    {
70
        return new ReceiptLine();
71
    }
72
}
73