Completed
Push — master ( bf4c92...3d0f9a )
by Alex
04:55
created

CalculatorTransformer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 15 1
1
<?php
2
3
namespace App\Http\Transformers;
4
5
6
class CalculatorTransformer extends Transformer
7
{
8
    public function transform($calcul)
9
    {
10
        return [
11
            'user_id' => $calcul['user_id'],
12
            'name' => $calcul['name'],
13
            'quantity_to_buy' =>(Float) $calcul['quantity_to_buy'],
14
            'quote_to_buy' =>(Float) $calcul['quote_to_buy'],
15
            'price_to_buy' => (Float)$calcul['price_to_buy'],
16
            'quantity_to_sell' => (Float)$calcul['quantity_to_sell'],
17
            'quote_to_sell' => (Float)$calcul['quote_to_sell'],
18
            'tax_percent_to_discount' => (Float)$calcul['tax_percent_to_discount'],
19
            'price_to_sell' => (Float)$calcul['price_to_sell'],
20
            'gains_or_losses' => (Float)$calcul['gains_or_losses'],
21
        ];
22
    }
23
}