Conditions | 7 |
Paths | 6 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 7.5375 |
Changes | 0 |
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 | } |
||
23 | |||
24 | 2 | if (isset($searchResult['offer'])) { |
|
25 | 2 | $this->collection[] = new Offer($searchResult['offer']); |
|
26 | } |
||
27 | } elseif (is_object($searchResult) && ($searchResult instanceof MarketModel || $searchResult instanceof Offer) |
||
28 | ) { |
||
29 | $this->collection[] = $searchResult; |
||
30 | } |
||
31 | |||
32 | 2 | return $this; |
|
33 | } |
||
34 | |||
45 |