params = $params; } public function getParams(): array { if ($this->params === null) { throw new InvalidCallException('You need to set params first'); } return [ 'username' => $this->params->getUsername(), 'code' => $this->params->getCode(), 'link' => $this->params->getLink(), ]; } }