Skip to content

Instantly share code, notes, and snippets.

@praisedare
Created June 23, 2023 15:13
Show Gist options
  • Save praisedare/5c6a7214c2c9a64bc2d0dd2f21cce6f3 to your computer and use it in GitHub Desktop.
Save praisedare/5c6a7214c2c9a64bc2d0dd2f21cce6f3 to your computer and use it in GitHub Desktop.
<?php
trait EnumerableConstants
{
static function values()
{
return array_values (
(new \ReflectionClass(static::class))->getConstants()
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment