Completed
Push — master ( eaf36c...f92548 )
by Marcel
03:19
created

AttributeDataTrait::getAttributeData()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2.0185

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 5
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 10
ccs 5
cts 6
cp 0.8333
crap 2.0185
rs 10
1
<?php
2
3
namespace App\Form;
4
5
use Symfony\Component\Form\FormInterface;
6
7
trait AttributeDataTrait {
8 1
    public function getAttributeData(FormInterface $form) {
9 1
        $children = $form->get('group_attributes');
10
11 1
        $data = [ ];
12
13 1
        foreach($children as $child) {
14
            $data[$child->getName()] = $child->getData();
15
        }
16
17 1
        return $data;
18
    }
19
}