PHP SDK by CNIC

ResponseTranslator
in package

IBS ResponseTranslator

Table of Contents

Properties

$descriptionRegexMap  : array<string|int, mixed>
hidden class var of API description regex mappings for translation

Methods

translate()  : string
translate a raw api response
findMatch()  : bool
Finds a match in the given text and performs replacements based on patterns and placeholders.

Properties

$descriptionRegexMap

hidden class var of API description regex mappings for translation

private static array<string|int, mixed> $descriptionRegexMap = []

Methods

translate()

translate a raw api response

public static translate(string $raw, array<string|int, string> $cmd[, array<string|int, string> $ph = [] ]) : string
Parameters
$raw : string

API raw response

$cmd : array<string|int, string>

requested API command

$ph : array<string|int, string> = []

list of place holder vars

Return values
string

findMatch()

Finds a match in the given text and performs replacements based on patterns and placeholders.

protected static findMatch(string $regex, string &$newraw, string $val, array<string|int, string> $requestdata, array<string|int, string> $ph) : bool

This function searches for a specified regular expression pattern in the provided text and performs replacements based on the matched pattern, command data, and placeholder values.

Parameters
$regex : string

The regular expression pattern to search for.

$newraw : string

The input text where the match will be searched for and replacements applied.

$val : string

The value to be used in replacement if a match is found.

$requestdata : array<string|int, string>

The request data containing replacements, if applicable.

$ph : array<string|int, string>

An array of placeholder values for further replacements.

Return values
bool

Returns true if replacements were performed, false otherwise.

Loading…
On this page

Search results