Change ToJson on Base Enum

This commit is contained in:
Jérémy Munsch 2021-03-04 17:25:04 +01:00
parent a79173ec38
commit df8022c495
2 changed files with 10 additions and 2 deletions

View file

@ -30,4 +30,9 @@ All notable changes to `Enum` will be documented in this file.
## Version 0.1.1
### Fixed
- fixed performances issue on toValues and toLabels
- fixed performances issue on toValues and toLabels
## Version 0.1.2
### Changed
- changed toJson to output array with label and value

View file

@ -267,7 +267,10 @@ abstract class BaseEnum implements JsonSerializable, UrlRoutable
*/
public function jsonSerialize()
{
return $this->value;
return [
'value' => $this->value,
'label' => $this->label
];
}
public function __toString(): string