ImageCollection::init()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 10
cc 3
nc 2
nop 0
crap 3
1
<?php
2
3
4
namespace Zenwalker\CommerceML\Collections;
5
6
7
use Zenwalker\CommerceML\Model\Image;
0 ignored issues
show
Bug introduced by
The type Zenwalker\CommerceML\Model\Image was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Zenwalker\CommerceML\Model\Simple;
9
10
/**
11
 * Class Image
12
 *
13
 * @package Zenwalker\CommerceML\Model
14
 */
15
class ImageCollection extends Simple
16
{
17 1
    public function init()
18
    {
19 1
        if ($this->xml) {
20 1
            foreach ($this->xml as $image) {
21 1
                $this->append(new Image($this->owner, $image));
22
            }
23
        }
24 1
        parent::init();
25
    }
26
}