mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-23 02:11:10 +00:00
To restore coding standards of project, run ecs
This commit is contained in:
parent
e43a1a270f
commit
b6518c84c8
@ -17,16 +17,16 @@ final class GildedRose
|
||||
public function updateQuality(): void
|
||||
{
|
||||
foreach ($this->items as $item) {
|
||||
if ($item->name != 'Aged Brie' and $item->name != 'Backstage passes to a TAFKAL80ETC concert') {
|
||||
if ($item->name !== 'Aged Brie' and $item->name !== 'Backstage passes to a TAFKAL80ETC concert') {
|
||||
if ($item->quality > 0) {
|
||||
if ($item->name != 'Sulfuras, Hand of Ragnaros') {
|
||||
if ($item->name !== 'Sulfuras, Hand of Ragnaros') {
|
||||
$item->quality = $item->quality - 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($item->quality < 50) {
|
||||
$item->quality = $item->quality + 1;
|
||||
if ($item->name == 'Backstage passes to a TAFKAL80ETC concert') {
|
||||
if ($item->name === 'Backstage passes to a TAFKAL80ETC concert') {
|
||||
if ($item->sellIn < 11) {
|
||||
if ($item->quality < 50) {
|
||||
$item->quality = $item->quality + 1;
|
||||
@ -41,15 +41,15 @@ final class GildedRose
|
||||
}
|
||||
}
|
||||
|
||||
if ($item->name != 'Sulfuras, Hand of Ragnaros') {
|
||||
if ($item->name !== 'Sulfuras, Hand of Ragnaros') {
|
||||
$item->sellIn = $item->sellIn - 1;
|
||||
}
|
||||
|
||||
if ($item->sellIn < 0) {
|
||||
if ($item->name != 'Aged Brie') {
|
||||
if ($item->name != 'Backstage passes to a TAFKAL80ETC concert') {
|
||||
if ($item->name !== 'Aged Brie') {
|
||||
if ($item->name !== 'Backstage passes to a TAFKAL80ETC concert') {
|
||||
if ($item->quality > 0) {
|
||||
if ($item->name != 'Sulfuras, Hand of Ragnaros') {
|
||||
if ($item->name !== 'Sulfuras, Hand of Ragnaros') {
|
||||
$item->quality = $item->quality - 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,10 +4,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace Tests;
|
||||
|
||||
use ApprovalTests\Approvals;
|
||||
use GildedRose\GildedRose;
|
||||
use GildedRose\Item;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use ApprovalTests\Approvals;
|
||||
|
||||
/**
|
||||
* This unit test uses [Approvals](https://github.com/approvals/ApprovalTests.php).
|
||||
@ -20,22 +20,21 @@ use ApprovalTests\Approvals;
|
||||
*/
|
||||
class ApprovalTest extends TestCase
|
||||
{
|
||||
|
||||
public function testFoo(): void
|
||||
public function testFoo(): void
|
||||
{
|
||||
$items = [new Item('foo', 0, 0)];
|
||||
$app = new GildedRose($items);
|
||||
$app->updateQuality();
|
||||
|
||||
Approvals::verifyList($items);
|
||||
}
|
||||
Approvals::verifyList($items);
|
||||
}
|
||||
|
||||
public function testThirtyDays(): void
|
||||
{
|
||||
{
|
||||
ob_start();
|
||||
|
||||
$argv = ["", "30"];
|
||||
include(__DIR__.'/../fixtures/texttest_fixture.php');
|
||||
$argv = ['', '30'];
|
||||
include(__DIR__ . '/../fixtures/texttest_fixture.php');
|
||||
|
||||
$output = ob_get_clean();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user