Completed
Push — master ( 7f186d...ef28ef )
by Philip
03:23
created

EntityUtils::collectIds()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
4
namespace Dontdrinkandroot\Utils;
5
6
use Dontdrinkandroot\Entity\EntityInterface;
7
8
class EntityUtils
9
{
10
11
    /**
12
     * @param EntityInterface[] $entities
13
     *
14
     * @return array
15
     */
16
    public static function collectIds(array $entities)
17
    {
18
        $ids = [];
19
        foreach ($entities as $entity) {
20
            $ids[] = $entity->getId();
21
        }
22
23
        return $ids;
24
    }
25
}
26