DynamoDbClientAwareTrait::getMarshaler()   A
last analyzed

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
/**
9
 * Trait for DynamoDb client aware classes.
10
 *
11
 * @author Guillermo A. Fisher <[email protected]>
12
 */
13
trait DynamoDbClientAwareTrait
14
{
15
    /**
16
     * @var DynamoDbClient The DynamoDb client.
17
     */
18
    protected DynamoDbClient $client;
19
20
    /**
21
     * @var Marshaler The Marshaler.
22
     */
23
    protected Marshaler $marshaler;
24
25
    /**
26
     * Returns the client.
27
     *
28
     * @return DynamoDbClient The client.
29
     */
30 12
    public function getClient(): DynamoDbClient
31
    {
32 12
        return $this->client;
33
    }
34
35
    /**
36
     * Registers the client.
37
     *
38
     * @param DynamoDbClient $client The client.
39
     * @return static This object.
40
     */
41 54
    public function setClient(DynamoDbClient $client): static
42
    {
43 54
        $this->client = $client;
44 54
        return $this;
45
    }
46
47
    /**
48
     * Returns the Marshaler.
49
     *
50
     * @return Marshaler The Marshaler.
51
     */
52 20
    public function getMarshaler(): Marshaler
53
    {
54 20
        return $this->marshaler;
55
    }
56
57
    /**
58
     * Registers the Marshaler with this object.
59
     *
60
     * @param Marshaler $marshaler The Marshaler.
61
     * @return static This object.
62
     */
63 54
    public function setMarshaler(Marshaler $marshaler): static
64
    {
65 54
        $this->marshaler = $marshaler;
66 54
        return $this;
67
    }
68
}
69