| 1 | <?php |
||
| 17 | class PackageTransportCostCollection implements ArrayAccess, Countable, IteratorAggregate |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * Package costs |
||
| 21 | * |
||
| 22 | * @var array<int,\Inspirum\Balikobot\Model\Values\PackageTransportCost>|\Inspirum\Balikobot\Model\Values\PackageTransportCost[] |
||
| 23 | */ |
||
| 24 | private $costs = []; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Shipper code |
||
| 28 | * |
||
| 29 | * @var string|null |
||
| 30 | */ |
||
| 31 | private $shipper; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * OrderedPackageCollection constructor |
||
| 35 | * |
||
| 36 | * @param string|null $shipper |
||
| 37 | */ |
||
| 38 | 11 | public function __construct(string $shipper = null) |
|
| 42 | |||
| 43 | /** |
||
| 44 | * Add package cost |
||
| 45 | * |
||
| 46 | * @param \Inspirum\Balikobot\Model\Values\PackageTransportCost $package |
||
| 47 | * |
||
| 48 | * @return void |
||
| 49 | * |
||
| 50 | * @throws \InvalidArgumentException |
||
| 51 | */ |
||
| 52 | 7 | public function add(PackageTransportCost $package): void |
|
| 60 | |||
| 61 | /** |
||
| 62 | * Get shipper |
||
| 63 | * |
||
| 64 | * @return string |
||
| 65 | */ |
||
| 66 | 3 | public function getShipper(): string |
|
| 74 | |||
| 75 | /** |
||
| 76 | * Get EIDs |
||
| 77 | * |
||
| 78 | * @return array<int> |
||
| 79 | */ |
||
| 80 | 2 | public function getBatchIds(): array |
|
| 86 | |||
| 87 | /** |
||
| 88 | * Get total cost for all packages |
||
| 89 | * |
||
| 90 | * @return float |
||
| 91 | */ |
||
| 92 | 3 | public function getTotalCost(): float |
|
| 107 | |||
| 108 | /** |
||
| 109 | * Get currency code |
||
| 110 | * |
||
| 111 | * @return string |
||
| 112 | */ |
||
| 113 | 4 | public function getCurrencyCode(): string |
|
| 123 | |||
| 124 | /** |
||
| 125 | * Validate shipper |
||
| 126 | * |
||
| 127 | * @param \Inspirum\Balikobot\Model\Values\PackageTransportCost $package |
||
| 128 | * |
||
| 129 | * @return void |
||
| 130 | * |
||
| 131 | * @throws \InvalidArgumentException |
||
| 132 | */ |
||
| 133 | 9 | private function validateShipper(PackageTransportCost $package): void |
|
| 151 | |||
| 152 | /** |
||
| 153 | * Determine if an item exists at an offset |
||
| 154 | * |
||
| 155 | * @param int $key |
||
| 156 | * |
||
| 157 | * @return bool |
||
| 158 | */ |
||
| 159 | 1 | public function offsetExists($key) |
|
| 163 | |||
| 164 | /** |
||
| 165 | * Get an item at a given offset |
||
| 166 | * |
||
| 167 | * @param int $key |
||
| 168 | * |
||
| 169 | * @return \Inspirum\Balikobot\Model\Values\PackageTransportCost |
||
| 170 | */ |
||
| 171 | 2 | public function offsetGet($key) |
|
| 175 | |||
| 176 | /** |
||
| 177 | * Set the item at a given offset |
||
| 178 | * |
||
| 179 | * @param int $key |
||
| 180 | * @param \Inspirum\Balikobot\Model\Values\PackageTransportCost $value |
||
| 181 | * |
||
| 182 | * @return void |
||
| 183 | */ |
||
| 184 | 2 | public function offsetSet($key, $value) |
|
| 190 | |||
| 191 | /** |
||
| 192 | * Unset the item at a given offset |
||
| 193 | * |
||
| 194 | * @param int $key |
||
| 195 | * |
||
| 196 | * @return void |
||
| 197 | */ |
||
| 198 | 1 | public function offsetUnset($key) |
|
| 202 | |||
| 203 | /** |
||
| 204 | * Count elements of an object |
||
| 205 | * |
||
| 206 | * @return int |
||
| 207 | */ |
||
| 208 | 3 | public function count(): int |
|
| 212 | |||
| 213 | /** |
||
| 214 | * Get an iterator for the items |
||
| 215 | * |
||
| 216 | * @return \ArrayIterator<int,\Inspirum\Balikobot\Model\Values\PackageTransportCost> |
||
|
1 ignored issue
–
show
|
|||
| 217 | */ |
||
| 218 | 1 | public function getIterator(): ArrayIterator |
|
| 222 | } |
||
| 223 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.