Passed
Push — next ( fad6bc...2b9454 )
by Bas
02:29
created

AdministrationClient::version()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 8
c 1
b 0
f 0
ccs 5
cts 5
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ArangoClient\Administration;
6
7
use ArangoClient\Connector;
8
use ArangoClient\Exceptions\ArangoException;
9
use GuzzleHttp\Exception\GuzzleException;
10
11
class AdministrationClient
12
{
13
    /**
14
     * @var Connector
15
     */
16
    protected Connector $connector;
17
18
    /**
19
     * Documents constructor.
20
     * @param  Connector  $connector
21
     */
22 21
    public function __construct(Connector $connector)
23
    {
24 21
        $this->connector = $connector;
25 21
    }
26
27
    /**
28
     *
29
     * @SuppressWarnings(PHPMD.BooleanArgumentFlag)
30
     *
31
     * @param  bool  $details
32
     * @return array<mixed>
33
     *
34
     * @throws ArangoException
35
     * @throws GuzzleException
36
     */
37 2
    public function version(bool $details = false): array
38
    {
39 2
        return (array) $this->connector->request(
40 2
            'get',
41 2
            '/_api/version',
42
            [
43
                'query' => [
44 2
                    'details' => $details
45
                ]
46
            ]
47
        );
48
    }
49
}
50