Passed
Push — master ( 0581c8...51e323 )
by Bao
03:09
created

ProjectionExpression   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 20
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A parse() 0 7 2
A __construct() 0 3 1
1
<?php
2
3
namespace BaoPham\DynamoDb\Parsers;
4
5
class ProjectionExpression
6
{
7
    protected $names;
8
9 115
    public function __construct(ExpressionAttributeNames $names)
10
    {
11 115
        $this->names = $names;
12 115
    }
13
14
    /**
15
     * @param array $columns
16
     * @return string
17
     */
18 8
    public function parse(array $columns)
19
    {
20 8
        foreach ($columns as $column) {
21 4
            $this->names->set($column);
22
        }
23
24 8
        return join(', ', $this->names->placeholders());
25
    }
26
}
27