isInvalidOrFloat($value)) { throw new AtomException(get_class($this), $value); } $this->value = (int)$value; } protected function isInvalidOrFloat($value) { return is_numeric($value) === false || is_float($value) === true; } public function getValue() { return $this->value; } }