GildedRose-Refactoring-Kata/php/src/Item.php
Pen-y-Fan ed7a787e4f Updated PHP version for PHP7.2+
Removed PHP5 (no longer supported)
Renamed PHP7 to PHP - consistent with other kata
Added the same helpers as other PHP Kata
Updated the code to PHP7.2+ standard
Didn't change GildedRose updateQuality method
Updated GildedRoseTest (still failing)
Added ApprovalTest (passing)
- same text file as texttests / ThirtyDays / stdout.gr (only renamed).
2020-07-23 22:47:36 +01:00

36 lines
546 B
PHP

<?php
declare(strict_types=1);
namespace GildedRose;
final class Item
{
/**
* @var string
*/
public $name;
/**
* @var int
*/
public $sell_in;
/**
* @var int
*/
public $quality;
public function __construct(string $name, int $sell_in, int $quality)
{
$this->name = $name;
$this->sell_in = $sell_in;
$this->quality = $quality;
}
public function __toString(): string
{
return "{$this->name}, {$this->sell_in}, {$this->quality}";
}
}