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

ImpuestosP::getRetencionesP()   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 ImpuestosP extends AbstractElement
8
{
9
    public function getElementName(): string
10
    {
11
        return 'pago20:ImpuestosP';
12
    }
13
14
    public function getChildrenOrder(): array
15
    {
16
        return [
17
        'pago20:RetencionesP',
18
        'pago20:TrasladosP',
19
        ];
20
    }
21
22
    public function getRetencionesP(): RetencionesP
23
    {
24
        return $this->helperGetOrAdd(new RetencionesP());
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->helperGetO...Pagos20\RetencionesP()) could return the type CfdiUtils\Elements\Pagos20\ImpuestosP which is incompatible with the type-hinted return CfdiUtils\Elements\Pagos20\RetencionesP. Consider adding an additional type-check to rule them out.
Loading history...
25
    }
26
27
    public function addRetencionesP(array $attributes = []): RetencionesP
28
    {
29
        $subject = $this->getRetencionesP();
30
        $subject->addAttributes($attributes);
31
        return $subject;
32
    }
33
34
    public function getTrasladosP(): TrasladosP
35
    {
36
        return $this->helperGetOrAdd(new TrasladosP());
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->helperGetO...s\Pagos20\TrasladosP()) could return the type CfdiUtils\Elements\Pagos20\ImpuestosP which is incompatible with the type-hinted return CfdiUtils\Elements\Pagos20\TrasladosP. Consider adding an additional type-check to rule them out.
Loading history...
37
    }
38
39
    public function addTrasladosP(array $attributes = []): TrasladosP
40
    {
41
        $subject = $this->getTrasladosP();
42
        $subject->addAttributes($attributes);
43
        return $subject;
44
    }
45
}
46