paginator = $paginator; return $this; } /** * Returns the KnpPaginator instance. */ public function getPaginator(): PaginatorInterface { if (null === $this->paginator) { throw new \UnexpectedValueException('Null Paginator instance.'); } return $this->paginator; } }