/** * @param bool|float|\Granam\Scalar\ScalarInterface|int|string $value * @throws Exceptions\InvalidLevelRank * @throws \Doctrineum\Scalar\Exceptions\UnexpectedValueToEnum */ public function __construct($value) { parent::__construct($value); if ($this->getValue() < 0) { throw new Exceptions\InvalidLevelRank('Level can not be lesser than 0, got ' . ValueDescriber::describe($value)); } }
/** * Does NOT gives same instance for same value. * * @param int|IntegerInterface $enumValue */ protected function __construct($enumValue) { /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ parent::__construct($enumValue); $this->noticeChange(); }