Passed
Push — master ( 191f59...1ee7f2 )
by Aleksandr
01:40
created

SpecificationCollection::init()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 8
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0
cc 3
nc 2
nop 0
crap 12
1
<?php
2
3
4
namespace Zenwalker\CommerceML\Collections;
5
6
7
use Zenwalker\CommerceML\Model\Simple;
8
9
/**
10
 * Class SpecificationCollection
11
 *
12
 * @package Zenwalker\CommerceML\Model
13
 */
14
class SpecificationCollection extends Simple
15
{
16
    public function init()
17
    {
18
        if (isset($this->xml->ХарактеристикаТовара)) {
19
            foreach ($this->xml->ХарактеристикаТовара as $specification) {
20
                $this->append(new Simple($this->owner, $specification));
21
            }
22
        }
23
        parent::init();
24
    }
25
}