CurrencyTransformer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 21
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 12 1
1
<?php
2
3
namespace App\Containers\Country\UI\API\Transformers;
4
5
use App\Containers\Country\Models\Country;
6
use App\Ship\Parents\Transformers\Transformer;
7
8
/**
9
 * Class CurrencyTransformer.
10
 *
11
 * @author Mahmoud Zalt <[email protected]>
12
 */
13
class CurrencyTransformer extends Transformer
14
{
15
16
    /**
17
     * @param \App\Containers\Country\UI\API\Transformers\Country $country
18
     *
19
     * @return  array
20
     */
21
    public function transform(Country $country)
22
    {
23
        return [
24
            'type'         => 'currency',
25
            'id'           => (int)$country->id,
26
            'name'         => $country->currency,
27
            'code'         => $country->currency_code,
28
            'symbol'       => $country->currency_symbol,
29
            'sub_unit'     => $country->currency_sub_unit,
30
            'country_name' => $country->name,
31
        ];
32
    }
33
}
34