Stockroom   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 88.89%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 10
c 1
b 0
f 0
dl 0
loc 19
ccs 8
cts 9
cp 0.8889
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getPackageStockroom() 0 8 2
A propertyAliases() 0 5 1
1
<?php
2
3
namespace Zenwalker\CommerceML\Model;
4
5
class Stockroom extends Simple
6
{
7
    private $_packageStockroom;
8
9 1
    public function getPackageStockroom()
10
    {
11 1
        if ($this->_packageStockroom) {
12
            return $this->_packageStockroom;
13
        }
14 1
        $id = $this->id;
15 1
        $xml = current($this->owner->offerPackage->xpath('//c:Склад[c:Ид = :id]', ['id' => $id]));
16 1
        return $this->_packageStockroom = new static($this->owner, $xml);
17
    }
18
19 1
    public function propertyAliases()
20
    {
21 1
        return array_merge(parent::propertyAliases(), [
22 1
            'ИдСклада' => 'id',
23
            'КоличествоНаСкладе' => 'count',
24
        ]);
25
    }
26
}