Parcels::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 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