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