From eb6410282801fa4511855de001c2c1deb6e4bf50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20DECOOL?= Date: Sat, 16 Apr 2022 09:39:34 +0200 Subject: [PATCH] Implement Stringable interface on Enum --- composer.json | 5 ++++- src/Enum.php | 2 +- stubs/Stringable.php | 11 +++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 stubs/Stringable.php diff --git a/composer.json b/composer.json index 924f924..978cb19 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,10 @@ "autoload": { "psr-4": { "MyCLabs\\Enum\\": "src/" - } + }, + "classmap": [ + "stubs/Stringable.php" + ] }, "autoload-dev": { "psr-4": { diff --git a/src/Enum.php b/src/Enum.php index 89064eb..4c94cf6 100644 --- a/src/Enum.php +++ b/src/Enum.php @@ -19,7 +19,7 @@ * @psalm-immutable * @psalm-consistent-constructor */ -abstract class Enum implements \JsonSerializable +abstract class Enum implements \JsonSerializable, \Stringable { /** * Enum value diff --git a/stubs/Stringable.php b/stubs/Stringable.php new file mode 100644 index 0000000..4811af7 --- /dev/null +++ b/stubs/Stringable.php @@ -0,0 +1,11 @@ +