mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-11 20:02:09 +00:00
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).
36 lines
546 B
PHP
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}";
|
|
}
|
|
}
|