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).
This commit is contained in:
Pen-y-Fan committed 2020-07-23 22:47:36 +01:00
1 parent fbe24e35b5
commit ed7a787e4f
34 files changed
+5576 -1794

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
<?php
require_once __DIR__ . '/../vendor/autoload.php';
use GildedRose\GildedRose;
use GildedRose\Item;
echo "OMGHAI!" . PHP_EOL;
$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)
);
$app = new GildedRose($items);
$days = 2;
if (count($argv) > 1) {
$days = (int) $argv[1];
}
for ($i = 0; $i < $days; $i++) {
echo("-------- day $i --------" . PHP_EOL);
echo("name, sellIn, quality" . PHP_EOL);
foreach ($items as $item) {
echo $item . PHP_EOL;
}
echo PHP_EOL;
$app->updateQuality();
}