Passed
Push — master ( 17c5f7...cb633b )
by Stefan
04:29 queued 02:00
created

RateTimeInTransit::getRateTimeInTransit()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 7

Duplication

Lines 12
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 12
loc 12
ccs 0
cts 8
cp 0
rs 9.4285
c 1
b 0
f 0
cc 2
eloc 7
nc 2
nop 1
crap 6
1
<?php
2
3
namespace Ups;
4
5
use DOMDocument;
6
use DOMElement;
7
use Exception;
8
use SimpleXMLElement;
9
use Ups\Entity\RateRequest;
10
use Ups\Entity\RateResponse;
11
use Ups\Entity\Shipment;
12
13
/**
14
 * RateTimeInTransit API Wrapper.
15
 */
16
class RateTimeInTransit extends Rate
17
{
18
    /**
19
     * @param $rateRequest
20
     *
21
     * @throws Exception
22
     *
23
     * @return RateResponse
24
     */
25 View Code Duplication
    public function getRateTimeInTransit($rateRequest)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
26
    {
27
        if ($rateRequest instanceof Shipment) {
28
            $shipment = $rateRequest;
29
            $rateRequest = new RateRequest();
30
            $rateRequest->setShipment($shipment);
31
        }
32
33
        $this->requestOption = 'Ratetimeintransit';
34
35
        return $this->sendRequest($rateRequest);
36
    }
37
38
    /**
39
     * @param $rateRequest
40
     *
41
     * @throws Exception
42
     *
43
     * @return RateResponse
44
     */
45 View Code Duplication
    public function shopRatesTimeInTransit($rateRequest)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
46
    {
47
        if ($rateRequest instanceof Shipment) {
48
            $shipment = $rateRequest;
49
            $rateRequest = new RateRequest();
50
            $rateRequest->setShipment($shipment);
51
        }
52
53
        $this->requestOption = 'Shoptimeintransit';
54
55
        return $this->sendRequest($rateRequest);
56
    }
57
}
58