All Enum Cases

no-email (Damien Seguy), Damien Seguy
Mon, 02 Dec 2024 00:00:00 +0000

One convenient aspect of enumerations is that they come with a full list of their cases. Call the ``::cases()`` on any enumeration to get the full list of elements.
Then, convert this list into their scalar representation, if any, by calling ``array_column``, with the public property ``value``.
And it always works with the ``name`` property, to collect the names of the cases.