public function addPageComponent(PageComponent $pageComponent, $position = -1) {
        if (!is_int($position)) {
            throw new \InvalidArgumentException('position should be of type int');
        }

        if ($position < 0) {
            $position = count($this->pageComponents);
        }

        Utils::array_insert($this->pageComponents, $pageComponent, $position);

        return $this;
    }