mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-17 23:41:27 +00:00
separate into classes
This commit is contained in:
parent
4615681e68
commit
e6e459351d
10
php7/src/AgedBried.php
Normal file
10
php7/src/AgedBried.php
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
|
|
||||||
|
class AgedBried
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
10
php7/src/BackstagePasses.php
Normal file
10
php7/src/BackstagePasses.php
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
|
|
||||||
|
class BackstagePasses
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
22
php7/src/DefaultItem.php
Normal file
22
php7/src/DefaultItem.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
|
|
||||||
|
class DefaultItem extends GildedRose
|
||||||
|
{
|
||||||
|
private $item;
|
||||||
|
|
||||||
|
public function __construct($item) {
|
||||||
|
$this->item = $item;
|
||||||
|
}
|
||||||
|
public function updateQuality(){
|
||||||
|
$this->item->quality -= 1;
|
||||||
|
if ($this->item->sell_in <= 0) {
|
||||||
|
$this->item->quality -= 1;
|
||||||
|
}
|
||||||
|
$this->item->sell_in -= 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
10
php7/src/Sulfaras.php
Normal file
10
php7/src/Sulfaras.php
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
|
|
||||||
|
class Sulfaras
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user