Completed
Push — master ( b736eb...f06be5 )
by Laurens
03:50 queued 01:55
created

ImageParser   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 18
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A parseArray() 0 10 2
A parse() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LauLamanApps\IzettleApi\Client\Universal;
6
7
use LauLamanApps\IzettleApi\API\Image;
8
use LauLamanApps\IzettleApi\API\ImageCollection;
9
10
final class ImageParser
11
{
12 5
    public static function parseArray(array $images)
13
    {
14 5
        $collection = new ImageCollection();
15
16 5
        foreach ($images as $image) {
17 5
            $collection->add(self::parse($image));
18
        }
19
20 5
        return $collection;
21
    }
22
23 5
    private static function parse($data): Image
24
    {
25 5
        return new Image($data);
26
    }
27
}
28