clevis/utils-enum-constants

Utility to get values of constants of given prefix.

dev-master 2013-08-26 20:44 UTC

This package is not auto-updated.

Last update: 2020-09-14 06:49:48 UTC


README

Utility to get values of constants of given prefix.

Example usage:

class Foo
{
	const PREFIX_FOO = 'foo';
	const PREFIX_BAR = 'bar';
	const SOME_UNRELATED_CONSTANT = 'whatever';
}

var_export(Clevis\Utils\EnumConstants::getEnumValues('Foo', 'PREFIX_'));

Prints out:

array(
	'foo' => 'foo',
	'bar' => 'bar'
)