Completed
Push — master ( efafaa...1ce8a3 )
by Avtandil
05:26
created

TransformableArrayResource   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getTransformed() 0 9 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Longman\LaravelLodash\Http\Resources;
6
7
class TransformableArrayResource extends ArrayResource
8
{
9
    public function getTransformed(): array
10
    {
11
        $data = [];
12
        foreach ($this->getTransformFields() as $from => $to) {
13
            $data[$to] = $this->resource[$from];
14
        }
15
16
        return $data;
17
    }
18
}
19