UrlBuilder
in package
Builds request URLs from domain, path, and optional query parameters.
Table of Contents
Properties
Methods
- build() : string
- Builds the final URL string from domain, path, and query values.
- withDomain() : self
- Sets the base domain (scheme + host) for the URL.
- withPath() : self
- Sets the request path and validates it during build.
- withQuery() : self
- Sets query parameters to append to the URL.
Properties
$domain
private
string
$domain
= ''
$path
private
string
$path
= '/'
$query
private
array<string, mixed>
$query
= array()
Methods
build()
Builds the final URL string from domain, path, and query values.
public
build() : string
Return values
stringwithDomain()
Sets the base domain (scheme + host) for the URL.
public
withDomain(string $domain) : self
Parameters
- $domain : string
Return values
selfwithPath()
Sets the request path and validates it during build.
public
withPath(string $path) : self
Parameters
- $path : string
Return values
selfwithQuery()
Sets query parameters to append to the URL.
public
withQuery(array<string, mixed> $query) : self
Parameters
- $query : array<string, mixed>