Parcels   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 21
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A addParcel() 0 5 1
1
<?php
2
namespace MrPrompt\ShipmentCommon\Base;
3
4
use SplFixedArray;
5
6
/**
7
 * Parcels
8
 *
9
 * @author Thiago Paes <[email protected]>
10
 */
11
class Parcels extends SplFixedArray
12
{
13
    /**
14
     * Constructor
15
     *
16
     * @param int $quantity
17
     */
18 1
    public function __construct($quantity = 1)
19
    {
20 1
        parent::__construct($quantity);
21 1
    }
22
23
    /**
24
     * @param Parcel $parcel
25
     */
26 1
    public function addParcel(Parcel $parcel)
27
    {
28 1
        $this->offsetSet($this->key(), $parcel);
29 1
        $this->next();
30 1
    }
31
}
32