-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from DonSlon1/master
Přidání parametru size
- Loading branch information
Showing
2 changed files
with
76 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |