Completed
Push — master ( 42f197...d72e6b )
by Gilmar
24:25
created

Invoice::getShipDate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
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
use Gpupo\NetshoesSdk\Traits\DateTimeTrait;
20
21
/**
22
 * @method string getNumber()    Acesso a number
23
 * @method setNumber(string $number)    Define number
24
 * @method int getLine()    Acesso a line
25
 * @method setLine(integer $line)    Define line
26
 * @method string getAccessKey()    Acesso a accessKey
27
 * @method setAccessKey(string $accessKey)    Define accessKey
28
 * @method setShipDate(string $shipDate)    Define shipDate
29
 * @method string getUrl()    Acesso a url
30
 * @method setUrl(string $url)    Define url
31
 */
32
class Invoice extends EntityAbstract implements EntityInterface
33
{
34
    use DateTimeTrait;
35
36
    protected $primaryKey = 'number';
37
38
    /**
39
     * @codeCoverageIgnore
40
     */
41
    public function getSchema()
42
    {
43
        return [
44
            'number'    => 'string',
45
            'line'      => 'integer',
46
            'accessKey' => 'string',
47
            'issueDate' => 'datetime',
48
            'shipDate'  => 'datetime',
49
            'url'       => 'string',
50
        ];
51
    }
52
53 4
    public function check()
54
    {
55 4
        $this->setRequiredSchema(['number', 'line', 'accessKey', 'issueDate']);
56 4
        $this->setOptionalSchema(['shipDate', 'url']);
57
58 4
        return $this->isValid();
59
    }
60
61 1
    public function getIssueDate()
62
    {
63 1
        return $this->dateGet('issueDate');
64
    }
65
66 1
    public function getShipDate()
67
    {
68 1
        return $this->dateGet('shipDate');
69
    }
70
}
71