Skip to content

Commit

Permalink
Merge pull request #35 from DonSlon1/master
Browse files Browse the repository at this point in the history
Přidání parametru size
  • Loading branch information
Salamek authored Aug 20, 2024
2 parents ddec7de + d919ff9 commit 7751bb0
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/Model/PacketAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ final class PacketAttributes implements IModel

private ?string $customerBarcode;

private ?Size $size;


public function __construct(
string $number,
Expand All @@ -75,7 +77,8 @@ public function __construct(
?string $carrierPickupPoint = null,
?string $carrierService = null,
?DispatchOrder $dispatchOrder = null,
?string $customerBarcode = null
?string $customerBarcode = null,
?Size $size = null
) {
$this->setNumber($number);
$this->setName($name);
Expand All @@ -99,6 +102,7 @@ public function __construct(
$this->setCarrierService($carrierService);
$this->setDispatchOrder($dispatchOrder);
$this->setCustomerBarcode($customerBarcode);
$this->setSize($size);
}


Expand Down Expand Up @@ -372,6 +376,16 @@ public function setCustomerBarcode(?string $customerBarcode): void
$this->customerBarcode = $customerBarcode;
}

public function getSize() : ?Size
{
return $this->size;
}

public function setSize(?Size $size) : void
{
$this->size = $size;
}


/**
* @return mixed[]
Expand Down
61 changes: 61 additions & 0 deletions src/Model/Size.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php

declare(strict_types=1);

namespace Salamek\Zasilkovna\Model;

final class Size implements IModel
{
private int $length;
private int $width;
private int $height;

public function __construct(
int $length,
int $width,
int $height
) {
$this->setLength($length);
$this->setWidth($width);
$this->setHeight($height);
}

public function getLength() : int
{
return $this->length;
}

public function setLength(int $length) : void
{
$this->length = $length;
}

public function getWidth() : int
{
return $this->width;
}

public function setWidth(int $width) : void
{
$this->width = $width;
}

public function getHeight() : int
{
return $this->height;
}

public function setHeight(int $height) : void
{
$this->height = $height;
}


/**
* @return mixed[]
*/
public function toArray(): array
{
return get_object_vars($this);
}
}

0 comments on commit 7751bb0

Please sign in to comment.