Documentation

ShlinkProxy extends AbstractProxy
in package

ShlinkProxy

Forwards a URL for shortening to shlink 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
Extracts the short URL from the shlink API response.
_getProxyPayload()  : array<string|int, mixed>
Overrides the abstract parent function to get contents from Shlink API.
_getProxyUrl()  : string
Overrides the abstract parent function 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()

Extracts the short URL from the shlink API response.

protected _extractShortUrl(array<string|int, mixed> $data) : string|null
Parameters
$data : array<string|int, mixed>
Tags
access

protected

Return values
string|null

_getProxyPayload()

Overrides the abstract parent function to get contents from Shlink API.

protected _getProxyPayload(Configuration $conf, string $link) : array<string|int, mixed>
Parameters
$conf : Configuration
$link : string
Tags
access

protected

Return values
array<string|int, mixed>

_getProxyUrl()

Overrides the abstract parent function to get the proxy URL.

protected _getProxyUrl(Configuration $conf) : string
Parameters
$conf : Configuration
Return values
string

logErrorWithClassName()

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

        
On this page

Search results