Completed
Push — master ( 19c355...d500cb )
by Guillermo A.
02:33
created

DynamoDbClientAwareTrait::getClient()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Guillermoandrae\DynamoDb\Contract;
4
5
use Aws\DynamoDb\DynamoDbClient;
6
use Aws\DynamoDb\Marshaler;
7
8
trait DynamoDbClientAwareTrait
9
{
10
    /**
11
     * @var DynamoDbClient The DynamoDb client.
12
     */
13
    protected $client;
14
15
    /**
16
     * @var Marshaler The Marshaler.
17
     */
18
    protected $marshaler;
19
20
    /**
21
     * Returns the client.
22
     *
23
     * @return DynamoDbClient The client.
24
     */
25 6
    public function getClient(): DynamoDbClient
26
    {
27 6
        return $this->client;
28
    }
29
30
    /**
31
     * Registers the client.
32
     *
33
     * @param mixed $client The client.
34
     * @return mixed This object.
35
     */
36 35
    public function setClient(DynamoDbClient $client)
37
    {
38 35
        $this->client = $client;
39 35
        return $this;
40
    }
41
42
    /**
43
     * Returns the Marshaler.
44
     *
45
     * @return Marshaler The Marshaler.
46
     */
47 12
    public function getMarshaler(): Marshaler
48
    {
49 12
        return $this->marshaler;
50
    }
51
52
    /**
53
     * Registers the Marshaler with this object.
54
     *
55
     * @param Marshaler $marshaler The Marshaler.
56
     * @return mixed This object.
57
     */
58 41
    public function setMarshaler(Marshaler $marshaler)
59
    {
60 41
        $this->marshaler = $marshaler;
61 41
        return $this;
62
    }
63
}
64