Documentation

AbstractProxy
in package

AbstractYes

AbstractProxy

Forwards a URL for shortening and stores the result.

Table of Contents

Properties

$_error  : string
error message
$_url  : string
shortened URL

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
access

private

$_url

shortened URL

private string $_url = ''
Tags
access

private

Methods

__construct()

constructor

public __construct(Configuration $conf, string $link) : mixed

initializes and runs the proxy class

Parameters
$conf : Configuration
$link : string
Tags
access

public

getError()

Returns the (untranslated) error message

public getError() : string
Tags
access

public

Return values
string

getUrl()

Returns the shortened URL

public getUrl() : string
Tags
access

public

Return values
string

isError()

Returns true if any error has occurred

public isError() : bool
Tags
access

public

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
access

protected

Return values
array<string|int, mixed>

logErrorWithClassName()

private logErrorWithClassName(string $error) : mixed
Parameters
$error : string

        
On this page

Search results