mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 22:41:30 +00:00
Item documentation and formatting.
This commit is contained in:
parent
417fe40c7f
commit
4a05355b9c
@ -1,21 +1,54 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PHP version 7
|
||||
*
|
||||
* @category Stock_Items
|
||||
* @package Storehouse
|
||||
* @author Povilas Brilius <pbrilius@gmail.com>
|
||||
* @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 <pbrilius@gmail.com>
|
||||
* @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}";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user