Concat::id()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
namespace Desmond\functions\core;
3
use Desmond\functions\DesmondFunction;
4
use Desmond\ArgumentHelper;
5
6
class Concat extends DesmondFunction
7
{
8
    use ArgumentHelper;
9
10 334
    public function id()
11
    {
12 334
        return 'concat';
13
    }
14
15 6
    public function run(array $args)
16
    {
17 6
        $this->expectArguments(
18 6
            'concat',
19 6
            [0 => ['List'], 1 => ['List']],
20 6
            $args
21
        );
22 4
        $newList = $this->newReturnType('List');
23 4
        foreach ($args as $list) {
24 4
            foreach ($list->value() as $value) {
25 4
                $newList->set($value);
26
            }
27
        }
28 4
        return $newList;
29
    }
30
}
31