From 4a05355b9c7d579b167b94a17d6ca302f35b07c0 Mon Sep 17 00:00:00 2001 From: Povilas Brilius Date: Fri, 1 May 2020 19:10:58 +0300 Subject: [PATCH] Item documentation and formatting. --- php7/src/Item.php | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/php7/src/Item.php b/php7/src/Item.php index 9ff2741b..83d7c3c1 100644 --- a/php7/src/Item.php +++ b/php7/src/Item.php @@ -1,21 +1,54 @@ + * @license eupl-1.1 https://help.github.com/en/github/creating-cloning-and-archiving-repositories/licensing-a-repository + * @link pbgroupeu.wordpress.com + */ + namespace App; -final class Item { +/** + * Stock item + * + * @category LIFO + * @package Storehouse + * @author Povilas Brilius + * @license eupl-1.1 https://help.github.com/en/github/creating-cloning-and-archiving-repositories/licensing-a-repository + * @link pbgroupeu.worpress.com + */ +final class Item +{ public $name; public $sell_in; public $quality; - function __construct($name, $sell_in, $quality) { + /** + * Std constructor + * + * @param string $name Label + * @param integer $sell_in Sellout in days + * @param integer $quality Qualitative assessment in integer type + */ + function __construct(string $name, int $sell_in, int $quality) + { $this->name = $name; $this->sell_in = $sell_in; $this->quality = $quality; } - public function __toString() { + /** + * Typographed to string magic + * + * @return string + */ + public function __toString() + { return "{$this->name}, {$this->sell_in}, {$this->quality}"; } } -