mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-17 15:31:27 +00:00
42 lines
1.1 KiB
PHP
42 lines
1.1 KiB
PHP
<?php
|
|
|
|
require_once __DIR__ . '/../vendor/autoload.php';
|
|
|
|
use App\GildedRose;
|
|
use App\GildedRoseProductsService;
|
|
use App\Item;
|
|
|
|
echo "OMGHAI!\n";
|
|
|
|
$items = array(
|
|
new Item('+5 Dexterity Vest', 10, 20),
|
|
new Item('Aged Brie', 2, 0),
|
|
new Item('Elixir of the Mongoose', 5, 7),
|
|
new Item('Sulfuras, Hand of Ragnaros', 0, 80),
|
|
new Item('Sulfuras, Hand of Ragnaros', -1, 80),
|
|
new Item('Backstage passes to a TAFKAL80ETC concert', 15, 20),
|
|
new Item('Backstage passes to a TAFKAL80ETC concert', 10, 49),
|
|
new Item('Backstage passes to a TAFKAL80ETC concert', 5, 49),
|
|
// this conjured item does not work properly yet
|
|
new Item('Conjured Mana Cake', 3, 6),
|
|
new Item('Conjured Mana Cake', 3, -1)
|
|
);
|
|
|
|
$gildedRose = new GildedRose($items);
|
|
$app = new GildedRoseProductsService($gildedRose);
|
|
|
|
$days = 2;
|
|
if (count($argv) > 1) {
|
|
$days = (int) $argv[1];
|
|
}
|
|
|
|
for ($i = 0; $i < $days; $i++) {
|
|
echo("-------- day $i --------\n");
|
|
echo("name, sellIn, quality\n");
|
|
foreach ($items as $item) {
|
|
echo $item . PHP_EOL;
|
|
}
|
|
echo PHP_EOL;
|
|
$app->updateQuality();
|
|
}
|