ConfigCollection   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 26
ccs 13
cts 13
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A toSimpleArray() 0 18 4
1
<?php
2
3
namespace Iris\Transfer\Catalog;
4
5
use Iris\Transfer\BaseCollection;
6
7
class ConfigCollection extends BaseCollection
8
{
9
10
    /**
11
     * Export all configs of this config collection as an array of simple items (merging config and simple data)
12
     * @return array
13
     */
14 1
    public function toSimpleArray()
15
    {
16 1
        $return = array();
17
18 1
        foreach ($this as $config) {
19 1
            $data = $config->toCleanArray();
20 1
            if (isset($data['simple_collection'])) {
21 1
                $simpleCollection = $data['simple_collection'];
22 1
                unset($data['simple_collection']);
23
24 1
                foreach ($simpleCollection as $simple) {
25 1
                    $return[] = array_merge($simple->toCleanArray(), $data);
26 1
                }
27 1
            }
28 1
        }
29
30 1
        return $return;
31
    }
32
}
33