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

UpdateExpression::remove()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 7
c 0
b 0
f 0
ccs 4
cts 4
cp 1
rs 10
cc 2
nc 2
nop 1
crap 2
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