Conditions | 7 |
Paths | 6 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 7.6024 |
Changes | 2 | ||
Bugs | 1 | Features | 1 |
1 | <?php |
||
17 | 2 | public function add($searchResult) |
|
18 | { |
||
19 | 2 | if (is_array($searchResult)) { |
|
20 | 2 | if (isset($searchResult['model'])) { |
|
21 | 2 | $this->collection[] = MarketModel::getInstance($searchResult['model']); |
|
22 | 2 | } |
|
23 | |||
24 | 2 | if (isset($searchResult['offer'])) { |
|
25 | 2 | $this->collection[] = new Offer($searchResult['offer']); |
|
26 | 2 | } |
|
27 | |||
28 | 2 | } elseif (is_object($searchResult) && ($searchResult instanceof MarketModel || $searchResult instanceof Offer) |
|
29 | ) { |
||
30 | $this->collection[] = $searchResult; |
||
31 | } |
||
32 | |||
33 | 2 | return $this; |
|
34 | } |
||
35 | |||
46 |