Completed
Pull Request — master (#2)
by Ronaldo
01:43
created

CreditPointTransformer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 7 1
1
<?php
2
3
namespace WSW\SiftScience\Transformers\Entities;
4
5
use WSW\SiftScience\Entities\CreditPoint;
6
use WSW\SiftScience\Transformers\AbstractTransformer;
7
8
/**
9
 * Class CreditPointTransformer
10
 *
11
 * @package WSW\SiftScience\Transformers\Entities
12
 * @author Ronaldo Matos Rodrigues <[email protected]>
13
 */
14
class CreditPointTransformer extends AbstractTransformer
15
{
16
    /**
17
     * @param CreditPoint $creditPoint
18
     *
19
     * @return array
20
     */
21 1
    public function transform(CreditPoint $creditPoint)
22
    {
23 1
        return array_filter([
24 1
            '$amount' => $creditPoint->getAmount(),
25 1
            '$credit_point_type' => $creditPoint->getCreditPointType()
26
        ]);
27
    }
28
}
29