Service::getRedirection()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 8
ccs 5
cts 5
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
namespace PHPSC\PagSeguro\Requests;
3
4
use DateTime;
5
use PHPSC\PagSeguro\Service as BaseService;
6
use SimpleXMLElement;
7
8
/**
9
 * @author Luís Otávio Cobucci Oblonczyk <[email protected]>
10
 */
11
abstract class Service extends BaseService
12
{
13
    /**
14
     * @param SimpleXMLElement $obj
15
     *
16
     * @return Response
17
     */
18 1
    protected function getRedirection(SimpleXMLElement $obj)
19
    {
20 1
        return new Redirection(
21 1
            (string) $obj->code,
22 1
            new DateTime((string) $obj->date),
23 1
            $this->credentials->getUrl(static::REDIRECT_TO)
24
        );
25
    }
26
}
27