Response   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 32
rs 10
wmc 3
lcom 1
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A addShipment() 0 9 2
A getShipments() 0 4 1
fromXml() 0 1 ?
1
<?php namespace SimpleUPS\Track;
2
3
use SimpleUPS\Shipment;
4
5
/**
6
 * @internal
7
 */
8
abstract class Response extends \SimpleUPS\Api\Response
9
{
10
11
    private
12
        /* @var Shipment $shipments */
13
        $shipments;
14
15
    /**
16
     * @param Shipment $shipment
17
     *
18
     * @return Response
19
     */
20
    public function addShipment(Shipment $shipment)
21
    {
22
        if ($this->shipments === null) {
23
            $this->shipments = array();
24
        }
25
26
        $this->shipments[] = $shipment;
27
        return $this;
28
    }
29
30
    /**
31
     * @return Shipment[]|null
32
     */
33
    public function getShipments()
34
    {
35
        return $this->shipments;
36
    }
37
38
    abstract public function fromXml(\SimpleXMLElement $xml);
39
}