Please forgive me if this is stupid.
I had expected to be able to instantiate a BitMask from a compiled integer, ie so that new Bitmask(3) would later allow me to check if both the Enum with the value of 1 and the one with the value of 2 would be set. This doesn't appear to work.
namespace app\Bitmasks;
use Cruxinator\BitMask\BitMask;
class TestFlags extends BitMask
{
const GROUPA = 1 << 0;
const GROUPB = 1 << 1;
const GROUPC = 1 << 2;
}`
Now I was expecting to be able to do this:
$x = new TestFlags(3);
$x->isGROUPA(); // expected true
$x->isGROUPB(); // expected true
$x->isGROUPC(); // expected false
Instead of my expectation I receive Uncaught UnexpectedValueException: Value '3' is not part of the enum app\Bitmasks\TestFlags
Am I missing something obvious?
Please forgive me if this is stupid.
I had expected to be able to instantiate a BitMask from a compiled integer, ie so that
new Bitmask(3)would later allow me to check if both the Enum with the value of 1 and the one with the value of 2 would be set. This doesn't appear to work.Now I was expecting to be able to do this:
Instead of my expectation I receive
Uncaught UnexpectedValueException: Value '3' is not part of the enum app\Bitmasks\TestFlagsAm I missing something obvious?