DeleteShipmentRequest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
eloc 8
c 1
b 0
f 1
dl 0
loc 22
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 5 1
A getTrackingNumbers() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
namespace DPD\Interconnector\Request;
4
5
use DPD\Interconnector\Authentication;
6
7
class DeleteShipmentRequest extends Request implements RequestInterface
8
{
9
    private $trackingNumbers = [];
10
11
    public function __construct(Authentication $authentication, array $trackingNumbers)
12
    {
13
        parent::__construct($authentication);
14
15
        $this->trackingNumbers = $trackingNumbers;
16
    }
17
18
    public function toArray(): array
19
    {
20
        return array_merge(
21
            $this->authentication->toArray(),
22
            ['parcels' => $this->getTrackingNumbers()]
23
        );
24
    }
25
26
    public function getTrackingNumbers(): string
27
    {
28
        return implode('|', $this->trackingNumbers);
29
    }
30
}
31