ArrayToDmnTrait   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A getDmnFromArray() 0 11 3
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
}