Passed
Push — master ( a9e4c3...f94168 )
by Steffen
02:00
created

ArrayToDmnTrait::getDmnFromArray()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 3
eloc 5
nc 2
nop 1
dl 0
loc 11
rs 9.4285
c 1
b 0
f 1
1
<?php
2
3
namespace SteffenBrand\DmnDecisionTables\Model;
4
5
trait ArrayToDmnTrait
6
{
7
    /**
8
     * Converts an array of objects (that implement DmnConvertibleInterface) to an XML string.
9
     *
10
     * @param DmnConvertibleInterface[] $items
11
     * @return string
12
     */
13
    private function getDmnFromArray($items)
14
    {
15
        $xml = '';
16
17
        if (empty($items) === false) {
18
            foreach ($items as $item) {
19
                $xml .= $item->toDMN();
20
            }
21
        }
22
23
        return $xml;
24
    }
25
}