GetJson::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 2
dl 0
loc 8
rs 10
1
<?php
2
namespace CodeCloud\Bundle\ShopifyBundle\Api\Request;
3
4
use GuzzleHttp\Psr7\Request;
5
6
class GetJson extends Request
7
{
8
    /**
9
     * @param string $url
10
     * @param array $params
11
     */
12
    public function __construct($url, array $params = array())
13
    {
14
        if (!empty($params)) {
15
            $url .= '?'.http_build_query($params);
16
        }
17
18
        parent::__construct('GET', $url, [
19
            'Content-type' => 'application/json',
20
        ]);
21
    }
22
}
23