AttributeDataTrait::getAttributeData()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

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 0
cts 6
cp 0
crap 6
rs 10
1
<?php
2
3
namespace App\Form;
4
5
use Symfony\Component\Form\FormInterface;
6
7
trait AttributeDataTrait {
8
    public function getAttributeData(FormInterface $form): array {
9
        $children = $form->get('group_attributes');
10
11
        $data = [ ];
12
13
        foreach($children as $child) {
14
            $data[$child->getName()] = $child->getData();
15
        }
16
17
        return $data;
18
    }
19
}