Completed
Push — master ( f3d682...6367b5 )
by Gilmar
21:40
created

Transport   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 3
c 4
b 0
f 0
lcom 0
cbo 1
dl 0
loc 32
ccs 6
cts 6
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getSchema() 0 13 1
A check() 0 12 2
1
<?php
2
3
/*
4
 * This file is part of gpupo/netshoes-sdk
5
 * Created by Gilmar Pupo <[email protected]>
6
 * For the information of copyright and license you should read the file
7
 * LICENSE which is distributed with this source code.
8
 * Para a informação dos direitos autorais e de licença você deve ler o arquivo
9
 * LICENSE que é distribuído com este código-fonte.
10
 * Para obtener la información de los derechos de autor y la licencia debe leer
11
 * el archivo LICENSE que se distribuye con el código fuente.
12
 * For more information, see <http://www.g1mr.com/>.
13
 */
14
15
namespace Gpupo\NetshoesSdk\Entity\Order\Shippings;
16
17
use Gpupo\CommonSdk\Entity\EntityAbstract;
18
use Gpupo\CommonSdk\Entity\EntityInterface;
19
20
/**
21
 * @method string getCarrier()    Acesso a carrier
22
 * @method setCarrier(string $carrier)    Define carrier
23
 * @method string getDeliveryDate()    Acesso a deliveryDate
24
 * @method setDeliveryDate(string $deliveryDate)    Define deliveryDate
25
 * @method string getDeliveryService()    Acesso a deliveryService
26
 * @method setDeliveryService(string $deliveryService)    Define deliveryService
27
 * @method string getShipDate()    Acesso a shipDate
28
 * @method setShipDate(string $shipDate)    Define shipDate
29
 * @method string getTrackingLink()    Acesso a trackingLink
30
 * @method setTrackingLink(string $trackingLink)    Define trackingLink
31
 * @method string getTrackingNumber()    Acesso a trackingNumber
32
 * @method setTrackingNumber(string $trackingNumber)    Define trackingNumber
33
 * @method string getTrackingShipDate()    Acesso a trackingShipDate
34
 * @method setTrackingShipDate(string $trackingShipDate)    Define trackingShipDate
35
 */
36
class Transport extends EntityAbstract implements EntityInterface
37
{
38
    /**
39
     * @codeCoverageIgnore
40
     */
41
    public function getSchema()
42
    {
43
        return [
44
            'carrier'               => 'string',
45
            'deliveryDate'          => 'string',
46
            'estimatedDeliveryDate' => 'string',
47
            'deliveryService'       => 'string',
48
            'shipDate'              => 'string',
49
            'trackingLink'          => 'string',
50
            'trackingNumber'        => 'string',
51
            'trackingShipDate'      => 'string',
52
        ];
53
    }
54
55 5
    public function check($status = null)
56
    {
57 5
        $list = ['deliveryDate'];
58
59 5
        if ('shipped' === $status) {
60 2
            $list = ['carrier', 'trackingNumber', 'deliveredDate', 'estimatedDelivery'];
61
        }
62
63 5
        $this->setRequiredSchema($list);
64
65 5
        return $this->validate();
66
    }
67
}
68