AbstractApi::call()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 6
rs 10
cc 1
nc 1
nop 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Eekes\VblApi\Api;
5
6
use GuzzleHttp\Client;
7
8
abstract class AbstractApi
9
{
10
    const BASE_URL = 'http://vblcb.wisseq.eu/VBLCB_WebService/data/';
11
12
    /**
13
     * @return array|\stdClass[]
14
     */
15
    protected function call(string $url): array
16
    {
17
        $client = new Client(['base_uri' => self:: BASE_URL]);
18
        $response = $client->get($url);
19
20
        return json_decode($response->getBody()->getContents());
21
    }
22
}