Passed
Pull Request — master (#113)
by Carlos C
02:01
created

Autotransporte::getIdentificacionVehicular()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

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
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace CfdiUtils\Elements\CartaPorte30;
4
5
use CfdiUtils\Elements\Common\AbstractElement;
6
7
class Autotransporte extends AbstractElement
8
{
9 2
    public function getElementName(): string
10
    {
11 2
        return 'cartaporte30:Autotransporte';
12
    }
13
14 2
    public function getChildrenOrder(): array
15
    {
16 2
        return [
17 2
            'cartaporte30:IdentificacionVehicular',
18 2
            'cartaporte30:Seguros',
19 2
            'cartaporte30:Remolques',
20 2
        ];
21
    }
22
23 1
    public function getIdentificacionVehicular(): IdentificacionVehicular
24
    {
25 1
        return $this->helperGetOrAdd(new IdentificacionVehicular());
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->helperGetO...ntificacionVehicular()) could return the type CfdiUtils\Elements\CartaPorte30\Autotransporte which is incompatible with the type-hinted return CfdiUtils\Elements\Carta...IdentificacionVehicular. Consider adding an additional type-check to rule them out.
Loading history...
26
    }
27
28 1
    public function addIdentificacionVehicular(array $attributes = []): IdentificacionVehicular
29
    {
30 1
        $subject = $this->getIdentificacionVehicular();
31 1
        $subject->addAttributes($attributes);
32 1
        return $subject;
33
    }
34
35 1
    public function getSeguros(): Seguros
36
    {
37 1
        return $this->helperGetOrAdd(new Seguros());
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->helperGetO...CartaPorte30\Seguros()) could return the type CfdiUtils\Elements\CartaPorte30\Autotransporte which is incompatible with the type-hinted return CfdiUtils\Elements\CartaPorte30\Seguros. Consider adding an additional type-check to rule them out.
Loading history...
38
    }
39
40 1
    public function addSeguros(array $attributes = []): Seguros
41
    {
42 1
        $subject = $this->getSeguros();
43 1
        $subject->addAttributes($attributes);
44 1
        return $subject;
45
    }
46
47 1
    public function getRemolques(): Remolques
48
    {
49 1
        return $this->helperGetOrAdd(new Remolques());
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->helperGetO...rtaPorte30\Remolques()) could return the type CfdiUtils\Elements\CartaPorte30\Autotransporte which is incompatible with the type-hinted return CfdiUtils\Elements\CartaPorte30\Remolques. Consider adding an additional type-check to rule them out.
Loading history...
50
    }
51
52 1
    public function addRemolques(array $attributes = []): Remolques
53
    {
54 1
        $subject = $this->getRemolques();
55 1
        $subject->addAttributes($attributes);
56 1
        return $subject;
57
    }
58
}
59