\TxTextControl\ReportingCloud\StdlibConsoleUtils

ReportingCloud console helper (used only for tests and demos)

Summary

Methods
Properties
Constants
checkCredentials()
apiKey()
baseUri()
errorMessage()
dump()
writeLn()
No public properties found
API_KEY
BASE_URI
No protected methods found
No protected properties found
N/A
getValueFromConstOrEnvVar()
getValueFromConst()
getValueFromEnvVar()
No private properties found
N/A

Constants

API_KEY

API_KEY = 'REPORTING_CLOUD_API_KEY'

Name of PHP constant or environmental variable storing API key

BASE_URI

BASE_URI = 'REPORTING_CLOUD_BASE_URI'

Name of PHP constant or environmental variable storing base URI

Methods

checkCredentials()

checkCredentials() : bool

Check that either the API key has been defined in environment variables

Returns

bool —

apiKey()

apiKey() : string

Return the ReportingCloud API key from a PHP constant or environmental variable

Returns

string —

baseUri()

baseUri() : string

Return the ReportingCloud base URI from a PHP constant or environmental variable

Returns

string —

errorMessage()

errorMessage() : string

Return error message explaining how to configure PHP constant or environmental variables

Returns

string —

dump()

dump(mixed  $value) : void

Dump information about a variable

Parameters

mixed $value

writeLn()

writeLn(string  $format = '', mixed  ...$args) : void

Write a line to the console

Parameters

string $format
mixed $args variadic

getValueFromConstOrEnvVar()

getValueFromConstOrEnvVar(string  $key) : string

Return a value from a PHP constant or environmental variable

Parameters

string $key

Returns

string —

getValueFromConst()

getValueFromConst(string  $key) : string

Return a value from a PHP constant

Parameters

string $key

Returns

string —

getValueFromEnvVar()

getValueFromEnvVar(string  $key) : string

Return a value from an environmental variable

Parameters

string $key

Returns

string —