Passed
Push — master ( dbb7af...afc37d )
by Carlos C
02:39 queued 11s
created

Emisor::getEntidadSNCF()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
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 4
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace CfdiUtils\Elements\Nomina12;
4
5
use CfdiUtils\Elements\Common\AbstractElement;
6
7
class Emisor extends AbstractElement
8
{
9 3
    public function getElementName(): string
10
    {
11 3
        return 'nomina12:Emisor';
12
    }
13
14 2
    public function getEntidadSNCF(): EntidadSNCF
15
    {
16
        /** @noinspection PhpIncompatibleReturnTypeInspection */
17 2
        return $this->helperGetOrAdd(new EntidadSNCF());
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->helperGetO...Nomina12\EntidadSNCF()) could return the type CfdiUtils\Elements\Nomina12\Emisor which is incompatible with the type-hinted return CfdiUtils\Elements\Nomina12\EntidadSNCF. Consider adding an additional type-check to rule them out.
Loading history...
18
    }
19
20 1
    public function addEntidadSNCF(array $attributes = []): EntidadSNCF
21
    {
22 1
        $entidadSncf = $this->getEntidadSNCF();
23 1
        $entidadSncf->addAttributes($attributes);
24 1
        return $entidadSncf;
25
    }
26
}
27