mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-10-15 02:25:40 +00:00
Bump to PHP 8.0+
PHP 7.4 was end of life November 2022, it's time to bump to PHP 8 standard 🎉
- updated starting code to PHP 8 standard
- upgraded tooling (code quality, static analysis) to the latest versions
- tested with PHP 8.0, 8.1 and 8.2
- the fixture is working
- the example test is failing, as expected
- code quality is as expected
- static analysis is ok
This commit is contained in:
1 parent
f7a3312e6b
commit
081c69b864
11 files changed
+87
-4602
No files matched your search
+7
-22
@@ -4,32 +4,17 @@ declare(strict_types=1);
|
||||
|
||||
namespace GildedRose;
|
||||
|
||||
final class Item
|
||||
final class Item implements \Stringable
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $sell_in;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $quality;
|
||||
|
||||
public function __construct(string $name, int $sell_in, int $quality)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->sell_in = $sell_in;
|
||||
$this->quality = $quality;
|
||||
public function __construct(
|
||||
public string $name,
|
||||
public int $sellIn,
|
||||
public int $quality
|
||||
) {
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return "{$this->name}, {$this->sell_in}, {$this->quality}";
|
||||
return (string) "{$this->name}, {$this->sellIn}, {$this->quality}";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user