Skip to content

Commit f739f79

Browse files
author
Fabio Piro
committed
Removed static all() and changes __toString
1 parent 136ea78 commit f739f79

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

src/Minimalcode/Enumeration/AbstractEnum.php

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -136,17 +136,6 @@ final public static function forOrdinal($ordinal)
136136
throw new InvalidArgumentException($message . ' Found:' . implode(', ', static::getOrdinals()));
137137
}
138138

139-
/**
140-
* @return static[]
141-
* @throws \ReflectionException
142-
* @throws LogicException On ambiguous constant values
143-
* @deprecated will be removed, use getEnumerators()
144-
*/
145-
final public static function all()
146-
{
147-
return static::getEnumerators();
148-
}
149-
150139
/**
151140
* Get a list of enumerator instances
152141
*
@@ -323,11 +312,11 @@ final public function getOrdinal()
323312
* Get the name of the enumerator
324313
*
325314
* @return string
326-
* @see getName()
315+
* @see getValue()
327316
*/
328317
public function __toString()
329318
{
330-
return $this->name;
319+
return \is_scalar($this->value) ? (string) $this->value : $this->name;
331320
}
332321

333322
/**

0 commit comments

Comments
 (0)