Completed
Pull Request — master (#212)
by Alexandru
45:00 queued 03:00
created

UpdateExpression::__construct()   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
dl 0
loc 3
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Rennokki\DynamoDb\Parsers;
4
5
class UpdateExpression
6
{
7
    /**
8
     * @var ExpressionAttributeNames
9
     */
10
    protected $names;
11
12 12
    public function __construct(ExpressionAttributeNames $names)
13
    {
14 12
        $this->names = $names;
15 12
    }
16
17 9
    public function reset()
18
    {
19 9
        $this->names->reset();
20 9
    }
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