private function coerceInt($value)
{
if ($value === '') {
throw new InvariantViolation('Int cannot represent non 32-bit signed integer value: (empty string)');
}
if (false === $value || true === $value) {
return (int) $value;
}
if (is_numeric($value) && $value <= self::MAX_INT && $value >= self::MIN_INT) {
return (int) $value;
}
throw new InvariantViolation('Int cannot represent non 32-bit signed integer value: ' . Utils::printSafe($value));
}