Passed
Push — master ( 28fd66...73e8c7 )
by Radu
02:10
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
    const CURRENCY_EUR = 'EUR';
11
12
    public function __construct($id = null)
13
    {
14
        parent::__construct();
15
        $this->setId($id);
16
        $this->setType(self::TYPE);
17
    }
18
19
    public function getService()
20
    {
21
        return $this->getMeta('service');
0 ignored issues
show
Bug introduced by
The method getMeta() does not exist on ParcelValue\Api\JsonApi\ResourceObjects\Shipment. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

21
        return $this->/** @scrutinizer ignore-call */ getMeta('service');

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
22
    }
23
24
    public function setService($service)
25
    {
26
        $this->setMeta('service', $service);
27
        return true;
28
    }
29
30
    public function setStatus(int $status)
31
    {
32
        $this->setMeta('status', $status);
33
        return true;
34
    }
35
}
36