mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-16 23:11:28 +00:00
Rename the property to be camel-cased
This commit is contained in:
parent
aa3aeb7a00
commit
5b6d211066
@ -29,12 +29,12 @@ final class GildedRose
|
||||
if ($item->quality < 50) {
|
||||
$item->quality = $item->quality + 1;
|
||||
if ($item->name == 'Backstage passes to a TAFKAL80ETC concert') {
|
||||
if ($item->sell_in < 11) {
|
||||
if ($item->sellIn < 11) {
|
||||
if ($item->quality < 50) {
|
||||
$item->quality = $item->quality + 1;
|
||||
}
|
||||
}
|
||||
if ($item->sell_in < 6) {
|
||||
if ($item->sellIn < 6) {
|
||||
if ($item->quality < 50) {
|
||||
$item->quality = $item->quality + 1;
|
||||
}
|
||||
@ -44,10 +44,10 @@ final class GildedRose
|
||||
}
|
||||
|
||||
if ($item->name != 'Sulfuras, Hand of Ragnaros') {
|
||||
$item->sell_in = $item->sell_in - 1;
|
||||
$item->sellIn = $item->sellIn - 1;
|
||||
}
|
||||
|
||||
if ($item->sell_in < 0) {
|
||||
if ($item->sellIn < 0) {
|
||||
if ($item->name != 'Aged Brie') {
|
||||
if ($item->name != 'Backstage passes to a TAFKAL80ETC concert') {
|
||||
if ($item->quality > 0) {
|
||||
|
||||
@ -14,22 +14,22 @@ final class Item
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $sell_in;
|
||||
public $sellIn;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $quality;
|
||||
|
||||
public function __construct(string $name, int $sell_in, int $quality)
|
||||
public function __construct(string $name, int $sellIn, int $quality)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->sell_in = $sell_in;
|
||||
$this->sellIn = $sellIn;
|
||||
$this->quality = $quality;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return "{$this->name}, {$this->sell_in}, {$this->quality}";
|
||||
return "{$this->name}, {$this->sellIn}, {$this->quality}";
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user