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

ResponseShopMatchGet   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 19
ccs 10
cts 10
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 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