Passed
Pull Request — 1.0.0 (#7)
by
unknown
07:05
created

IdCollection::toStringArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace StraTDeS\VO\Collection;
4
5
use StraTDeS\SharedKernel\Domain\Identity\Id;
6
7
class IdCollection extends AbstractCollection
8
{
9
    protected function itemClass(): string
10
    {
11
        return Id::class;
12
    }
13
14
    /** @return string[] */
15
    public function toStringArray(): array
16
    {
17
        return array_map(function (Id $id) {
18
            return $id->getHumanReadableId();
19
        }, $this->items);
20
    }
21
}
22