Completed
Pull Request — master (#212)
by Alexandru
10:59
created

UpdateExpression   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 70%

Importance

Changes 0
Metric Value
wmc 4
eloc 7
dl 0
loc 24
c 0
b 0
f 0
ccs 7
cts 10
cp 0.7
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A reset() 0 3 1
A remove() 0 7 2
A __construct() 0 3 1
1
<?php
2
3
namespace Rennokki\DynamoDb\Parsers;
4
5
class UpdateExpression
6
{
7
    /**
8
     * @var ExpressionAttributeNames
9
     */
10
    protected $names;
11
12 1
    public function __construct(ExpressionAttributeNames $names)
13
    {
14 1
        $this->names = $names;
15 1
    }
16
17
    public function reset()
18
    {
19
        $this->names->reset();
20
    }
21
22 1
    public function remove(array $attributes)
23
    {
24 1
        foreach ($attributes as $attribute) {
25 1
            $this->names->set($attribute);
26
        }
27
28 1
        return 'REMOVE ' . implode(', ', $this->names->placeholders());
29
    }
30
}
31