Completed
Pull Request — master (#139)
by
unknown
04:18
created

ResponseShopMatchGet::__construct()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 11
ccs 10
cts 10
cp 1
rs 9.4286
cc 3
eloc 7
nc 3
nop 1
crap 3
1
<?php
2
3
namespace Yandex\Market\Content\Models;
4
5
class ResponseShopMatchGet extends ResponseShopGet
6
{
7
    /**
8
     * Constructor
9
     *
10
     * @param array $data
11
     */
12 1
    public function __construct($data = array())
13
    {
14 1
        if (isset($data['shops'])) {
15 1
            $shop = reset($data['shops']);
16 1
            if (isset($shop['id'])) {
17 1
                $data['shop'] = $shop;
18 1
                unset($data['shops']);
19 1
            }
20 1
        }
21 1
        parent::__construct($data);
22 1
    }
23
}
24