4.0.1
Fixed
Fixed role reading/detection for role as backed enum.
The following would now work for a string field:
namespace App\Model\Enum;
use Cake\Database\Type\EnumLabelInterface;
use Cake\Utility\Inflector;
enum UserRole: string implements EnumLabelInterface {
case MAINTAINER = 'maintainer';
case ADMIN = 'admin';
/**
* @return string
*/
public function label(): string {
return Inflector::humanize(mb_strtolower($this->name));
}
}