Completed
Branch master (f94168)
by Steffen
03:41 queued 01:40
created

ArrayToDmnTrait   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 19
rs 10
c 1
b 0
f 1
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
}