Passed
Pull Request — master (#99)
by
unknown
13:18
created

InvoiceDescriptionsBuilder   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 8 2
A __construct() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace hiqdev\php\billing\product;
4
5
class InvoiceDescriptionsBuilder
6
{
7
    private BillingRegistry $registry;
8
9
    public function __construct(BillingRegistry $registry)
10
    {
11
        $this->registry = $registry;
12
    }
13
14
    public function build(): array
15
    {
16
        $descriptions = [];
17
        foreach ($this->registry->priceTypes() as $priceType) {
18
            $descriptions[] = $priceType->documentRepresentation();
19
        }
20
21
        return $descriptions;
22
    }
23
}
24