diff --git a/composer.json b/composer.json
index 2014673b4f83aea962af0e3bc7702a8ce202855f..574933797cfea53966a072f1c748a554cec1d844 100644
--- a/composer.json
+++ b/composer.json
@@ -29,7 +29,10 @@
"autoload": {
"psr-4": {
"MabeEnum\\": "src/"
- }
+ },
+ "classmap": [
+ "stubs/Stringable.php"
+ ]
},
"autoload-dev": {
"psr-4": {
diff --git a/psalm.xml b/psalm.xml
index 5cfb3f97bb32f53f22945013915af6a4cc377637..1aff26bad1f3e7b6a49a1150d673d74d3c5bde4b 100644
--- a/psalm.xml
+++ b/psalm.xml
@@ -1,6 +1,5 @@
<?xml version="1.0"?>
<psalm
- totallyTyped="true"
errorLevel="1"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
diff --git a/src/Enum.php b/src/Enum.php
index 3c9c293dade0b905e774060fcb5020b83d1201f5..9d09ae6ccf2773f4e45c4f7a06b9bfcb72f6f99f 100644
--- a/src/Enum.php
+++ b/src/Enum.php
@@ -17,7 +17,7 @@ use LogicException;
*
* @psalm-immutable
*/
-abstract class Enum
+abstract class Enum implements \Stringable
{
/**
* The selected enumerator value
diff --git a/stubs/Stringable.php b/stubs/Stringable.php
new file mode 100644
index 0000000000000000000000000000000000000000..77e037cb58d5acc48e5eb675c337fc2acff1d3f3
--- /dev/null
+++ b/stubs/Stringable.php
@@ -0,0 +1,11 @@
+<?php
+
+if (\PHP_VERSION_ID < 80000) {
+ interface Stringable
+ {
+ /**
+ * @return string
+ */
+ public function __toString();
+ }
+}