Passed
Push — master ( 7403b6...1afc4e )
by Radu
01:44
created

Shipment::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
namespace ParcelValue\Api\JsonApi\ResourceObjects;
3
4
class Shipment extends \WebServCo\Api\JsonApi\AbstractResourceObject
5
{
6
    const TYPE = 'shipment';
7
    const DATE_FORMAT = 'Y-m-d';
8
    const SERVICE_ECONOMY = 'economy';
9
    const SERVICE_EXPRESS = 'express';
10
11
    public function __construct($id = null)
12
    {
13
        parent::__construct();
14
        $this->setId($id);
15
        $this->setType(self::TYPE);
16
    }
17
18
    public function setService($service)
19
    {
20
        $this->setMeta('service', $service);
21
        return true;
22
    }
23
}
24