Completed
Push — master ( eec90d...2946e6 )
by Dmitriy
11s
created

Orders::getAll()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 4
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Yandex\Market\Partner\Models;
4
5
use Yandex\Common\ObjectModel;
6
7 View Code Duplication
class Orders extends ObjectModel
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
8
{
9
10
    protected $collection = [];
11
12
    protected $mappingClasses = [];
13
14
    protected $propNameMap = [];
15
16
    /**
17
     * Add item
18
     */
19 1
    public function add($order)
20
    {
21 1
        if (is_array($order)) {
22 1
            $this->collection[] = new Order($order);
23 1
        } elseif (is_object($order) && $order instanceof Order) {
24
            $this->collection[] = $order;
25
        }
26
27 1
        return $this;
28
    }
29
30
    /**
31
     * Get items
32
     */
33 1
    public function getAll()
34
    {
35 1
        return $this->collection;
36
    }
37
}
38