Passed
Pull Request — master (#29)
by Csaba
02:45
created

Finder::createClient()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 12
c 0
b 0
f 0
ccs 7
cts 7
cp 1
rs 9.4285
cc 2
eloc 8
nc 1
nop 0
crap 2
1
<?php
2
namespace Fathomminds\Rest\Database\DynamoDb;
3
4
use Fathomminds\Rest\Database\Finder as BaseFinder;
5
use Aws\DynamoDb\DynamoDbClient as Client;
6
use Aws\Sdk;
7
8
class Finder extends BaseFinder
9
{
10 1
    public function get()
11
    {
12 1
        $this->resultSet = [];
13 1
        return $this;
14
    }
15
16 1
    protected function createClient()
17
    {
18 1
        $sdk = new Sdk([
19 1
            'region' => getenv('AWS_SDK_REGION'),
20 1
            'version' => getenv('AWS_SDK_VERSION'),
21
            'http' => [
22 1
                'verify' => getenv('AWS_SDK_HTTP_VERIFY') === 'false' ? false : getenv('AWS_SDK_HTTP_VERIFY'),
23
            ]
24
        ]);
25 1
        $this->client = $sdk->createDynamoDb();
26 1
        return $this;
27
    }
28
}
29