Decoder::decode()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 9
ccs 6
cts 6
cp 1
crap 1
rs 9.9666
c 0
b 0
f 0
1
<?php
2
namespace PHPSC\PagSeguro\Purchases\Subscriptions;
3
4
use PHPSC\PagSeguro\Purchases\Decoder as BaseDecoder;
5
use SimpleXMLElement;
6
7
/**
8
 * @author Luís Otávio Cobucci Oblonczyk <[email protected]>
9
 */
10
class Decoder extends BaseDecoder
11
{
12
    /**
13
     * @param SimpleXMLElement $obj
14
     *
15
     * @return Transaction
16
     */
17 1
    public function decode(SimpleXMLElement $obj)
18
    {
19 1
        return new Subscription(
20 1
            (string) $obj->name,
21 1
            $this->createDetails($obj),
22 1
            (string) $obj->tracker,
23 1
            (string) $obj->charge
24
        );
25
    }
26
}
27