Passed
Push — master ( 927f67...9bd000 )
by Claudson
06:56
created

Transacional   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 15
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDetalhes() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
namespace Claudsonm\Pedi\Standards\PagSeguro\Layouts;
4
5
use Claudsonm\Pedi\Standards\PagSeguro\Records\DetalheTransacional;
6
use Claudsonm\Pedi\Standards\PagSeguro\Records\Header;
7
use Claudsonm\Pedi\Standards\PagSeguro\Records\Trailer;
8
9
class Transacional extends LayoutPagSeguro
10
{
11 20
    public function __construct()
12
    {
13 20
        $this->append(new Header())
14 20
            ->append(new DetalheTransacional(), '*')
15 20
            ->append(new Trailer());
16 20
    }
17
18
    /**
19
     * @return array|DetalheTransacional[]
20
     */
21 20
    public function getDetalhes(): array
22
    {
23 20
        return array_filter($this->getContents(), fn ($record) => $record instanceof DetalheTransacional);
24
    }
25
}
26