Passed
Pull Request — master (#5)
by Carlos C
02:00
created

RelatedItems::createItemFromStdClass()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 6
ccs 5
cts 5
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpCfdi\Finkok\Services\Cancel;
6
7
use ArrayIterator;
8
use PhpCfdi\Finkok\Services\AbstractCollection;
9
use stdClass;
10
11
/**
12
 * @method RelatedItem get(int $index)
13
 * @method RelatedItem first()
14
 * @method ArrayIterator|RelatedItem[] getIterator()
15
 */
16
class RelatedItems extends AbstractCollection
17
{
18 2
    protected function createItemFromStdClass(stdClass $content): object
19
    {
20 2
        return new RelatedItem(
21 2
            strval($content->{'uuid'} ?? ''),
22 2
            strval($content->{'emisor'} ?? ''),
23 2
            strval($content->{'receptor'} ?? '')
24
        );
25
    }
26
}
27