Change the constCache type to array.

This change allows to use several classes inheriting from BaseEnum
during the same excution.
With the old behavior, all the method calls would return the result
computed for the first enum.