protected function setId($id) { if (strlen($id) === 0) { throw new \RuntimeException('Invalid id. Expected a non-empty string.'); } $this->id = $id; }