Completed
Push — master ( 20a668...02e94f )
by Guillermo A.
02:17
created

AbstractRequest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 6
dl 0
loc 32
c 0
b 0
f 0
ccs 8
cts 8
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 3 1
A setMarshaler() 0 4 1
A __construct() 0 3 1
1
<?php
2
3
namespace Guillermoandrae\DynamoDb;
4
5
use Aws\DynamoDb\Marshaler;
6
use Guillermoandrae\Common\ArrayableInterface;
7
8
abstract class AbstractRequest implements ArrayableInterface, RequestInterface
9
{
10
    /**
11
     * @var Marshaler The Marshaler.
12
     */
13
    protected $marshaler;
14
15
    /**
16
     * Registers the Marshaler and table name with this object.
17
     *
18
     * @param Marshaler $marshaler The Marshaler.
19
     */
20 44
    public function __construct(Marshaler $marshaler)
21
    {
22 44
        $this->setMarshaler($marshaler);
23 44
    }
24
25
    /**
26
     * {@inheritDoc}
27
     */
28 44
    final public function setMarshaler(Marshaler $marshaler): RequestInterface
29
    {
30 44
        $this->marshaler = $marshaler;
31 44
        return $this;
32
    }
33
34
    /**
35
     * {@inheritDoc}
36
     */
37 24
    final public function toArray(): array
38
    {
39 24
        return $this->get();
40
    }
41
}
42