Completed
Push — master ( fb0370...84a128 )
by Ronaldo
03:03
created

CreditPointTransformer::transform()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 0
cts 4
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
crap 2
1
<?php
2
3
namespace WSW\SiftScience\Transformers;
4
5
use WSW\SiftScience\Entities\CreditPoint;
6
7
/**
8
 * Class CreditPointTransformer
9
 *
10
 * @package WSW\SiftScience\Transformers
11
 * @author Ronaldo Matos Rodrigues <[email protected]>
12
 */
13
class CreditPointTransformer extends AbstractTransformer
14
{
15
    /**
16
     * @param CreditPoint $creditPoint
17
     *
18
     * @return array
19
     */
20
    public function transform(CreditPoint $creditPoint)
21
    {
22
        return array_filter([
23
            '$amount' => $creditPoint->getAmount(),
24
            '$credit_point_type' => $creditPoint->getCreditPointType()
25
        ]);
26
    }
27
}
28