getUrl() public method

Build the URL for given domain alias, path and parameters.
public getUrl ( $name, $path = '', $params = [] ) : string
$name string The name of the domain, 'www' or 'api'
$path string without a leading slash
$params array query parameters
return string The URL for the given parameters. The URL query MUST be build with PHP_QUERY_RFC3986
 /**
  * {@inheritdoc}
  */
 public function getLoginUrl(LinkedInUrlGeneratorInterface $urlGenerator, $options = [])
 {
     // Generate a state
     $this->establishCSRFTokenState();
     // Build request params
     $requestParams = array_merge(['response_type' => 'code', 'client_id' => $this->appId, 'state' => $this->getStorage()->get('state'), 'redirect_uri' => null], $options);
     // Save the redirect url for later
     $this->getStorage()->set('redirect_uri', $requestParams['redirect_uri']);
     // if 'scope' is passed as an array, convert to space separated list
     $scopeParams = isset($options['scope']) ? $options['scope'] : null;
     if ($scopeParams) {
         //if scope is an array
         if (is_array($scopeParams)) {
             $requestParams['scope'] = implode(' ', $scopeParams);
         } elseif (is_string($scopeParams)) {
             //if scope is a string with ',' => make it to an array
             $requestParams['scope'] = str_replace(',', ' ', $scopeParams);
         }
     }
     return $urlGenerator->getUrl('www', 'oauth/v2/authorization', $requestParams);
 }