Completed
Push — master ( 752fc6...dd10bc )
by Carlos C
31s queued 14s
created

Pago::getImpuestosP()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace CfdiUtils\Elements\Pagos20;
4
5
use CfdiUtils\Elements\Common\AbstractElement;
6
7
class Pago extends AbstractElement
8
{
9
    public function getElementName(): string
10
    {
11
        return 'pago20:Pago';
12
    }
13
14
    public function getChildrenOrder(): array
15
    {
16
        return [
17
        'pago20:DoctoRelacionado',
18
        'pago20:ImpuestosP',
19
        ];
20
    }
21
22
    public function addDoctoRelacionado(array $attributes = []): DoctoRelacionado
23
    {
24
        $subject = new DoctoRelacionado($attributes);
25
        $this->addChild($subject);
26
        return $subject;
27
    }
28
29
    public function multiDoctoRelacionado(array ...$elementAttributes): self
30
    {
31
        foreach ($elementAttributes as $attributes) {
32
            $this->addDoctoRelacionado($attributes);
33
        }
34
        return $this;
35
    }
36
37
    public function getImpuestosP(): ImpuestosP
38
    {
39
        return $this->helperGetOrAdd(new ImpuestosP());
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->helperGetO...s\Pagos20\ImpuestosP()) could return the type CfdiUtils\Elements\Pagos20\Pago which is incompatible with the type-hinted return CfdiUtils\Elements\Pagos20\ImpuestosP. Consider adding an additional type-check to rule them out.
Loading history...
40
    }
41
42
    public function addImpuestosP(array $attributes = []): ImpuestosP
43
    {
44
        $subject = $this->getImpuestosP();
45
        $subject->addAttributes($attributes);
46
        return $subject;
47
    }
48
}
49