/** * Увеличивает размеры прямоугольника. * * Принимает либо значения, на которые нужно * увеличить прямоугольник, либо размер. * * @return Rectangle * @throws IllegalArgumentException */ public function inflate() { $args = func_get_args(); if (count($args) == 2) { $this->setWidth($this->getWidth() + $args[0]); $this->setHeight($this->getHeight() + $args[1]); } else { if (count($args) == 1) { $this->setSize(Size::add($this->getSize(), $args[0])); } else { throw new IllegalArgumentException(); } } return $this; }