public function setWidth($width) { if (!is_numeric($width)) { throw new Exception('Width must be numeric'); } $this->width = $width; return $this; }