Passed
Push — master ( 75f6ef...2d6bc8 )
by Siim
10:44
created

ArrayCollectionToArrayTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 9
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A arrayCollectionToArray() 0 7 2
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: siim
5
 * Date: 7.02.19
6
 * Time: 8:22
7
 */
8
9
namespace Sf4\Api\Utils\Traits;
10
11
use Doctrine\Common\Collections\ArrayCollection;
12
13
trait ArrayCollectionToArrayTrait
14
{
15
    protected function arrayCollectionToArray(ArrayCollection $items)
16
    {
17
        $data = [];
18
        foreach ($items as $item) {
19
            $data[] = $item->toArray();
20
        }
21
        return $data;
22
    }
23
}
24