AbstractProxy
in package
AbstractYes
AbstractProxy
Forwards a URL for shortening and stores the result.
Table of Contents
Properties
Methods
- __construct() : mixed
- constructor
- getError() : string
- Returns the (untranslated) error message
- getUrl() : string
- Returns the shortened URL
- isError() : bool
- Returns true if any error has occurred
- _extractShortUrl() : string|null
- Abstract method to extract the shortUrl from the response
- _getProxyPayload() : array<string|int, mixed>
- Abstract method to get the payload to send to the URL shortener
- _getProxyUrl() : string
- Abstract method to get the proxy URL
- logErrorWithClassName() : mixed
Properties
$_error
error message
private
string
$_error
= ''
Tags
$_url
shortened URL
private
string
$_url
= ''
Tags
Methods
__construct()
constructor
public
__construct(Configuration $conf, string $link) : mixed
initializes and runs the proxy class
Parameters
- $conf : Configuration
- $link : string
Tags
getError()
Returns the (untranslated) error message
public
getError() : string
Tags
Return values
stringgetUrl()
Returns the shortened URL
public
getUrl() : string
Tags
Return values
stringisError()
Returns true if any error has occurred
public
isError() : bool
Tags
Return values
bool_extractShortUrl()
Abstract method to extract the shortUrl from the response
protected
abstract _extractShortUrl(array<string|int, mixed> $data) : string|null
Parameters
- $data : array<string|int, mixed>
Return values
string|null_getProxyPayload()
Abstract method to get the payload to send to the URL shortener
protected
abstract _getProxyPayload(Configuration $conf, string $link) : array<string|int, mixed>
Parameters
- $conf : Configuration
- $link : string
Tags
Return values
array<string|int, mixed>_getProxyUrl()
Abstract method to get the proxy URL
protected
abstract _getProxyUrl(Configuration $conf) : string
Parameters
- $conf : Configuration
Return values
stringlogErrorWithClassName()
private
logErrorWithClassName(string $error) : mixed
Parameters
- $error : string