ConsoleUtils
extends AbstractStdlib
in package
ReportingCloud console helper (used only for tests and demos)
Table of Contents
Constants
- API_KEY = 'REPORTING_CLOUD_API_KEY'
- Name of PHP constant or environmental variable storing API key
- BASE_URI = 'REPORTING_CLOUD_BASE_URI'
- Name of PHP constant or environmental variable storing base URI
Methods
- apiKey() : string
- Return the ReportingCloud API key from a PHP constant or environmental variable
- baseUri() : string
- Return the ReportingCloud base URI from a PHP constant or environmental variable
- checkCredentials() : bool
- Check that either the API key has been defined in environment variables
- dump() : void
- Dump information about a variable
- errorMessage() : string
- Return error message explaining how to configure PHP constant or environmental variables
- writeLn() : void
- Write a line to the console
- getValueFromConst() : string
- Return a value from a PHP constant
- getValueFromConstOrEnvVar() : string
- Return a value from a PHP constant or environmental variable
- getValueFromEnvVar() : string
- Return a value from an environmental variable
Constants
API_KEY
Name of PHP constant or environmental variable storing API key
public
final string
API_KEY
= 'REPORTING_CLOUD_API_KEY'
Tags
BASE_URI
Name of PHP constant or environmental variable storing base URI
public
final string
BASE_URI
= 'REPORTING_CLOUD_BASE_URI'
Tags
Methods
apiKey()
Return the ReportingCloud API key from a PHP constant or environmental variable
public
static apiKey() : string
Return values
stringbaseUri()
Return the ReportingCloud base URI from a PHP constant or environmental variable
public
static baseUri() : string
Return values
stringcheckCredentials()
Check that either the API key has been defined in environment variables
public
static checkCredentials() : bool
Return values
booldump()
Dump information about a variable
public
static dump(mixed $value) : void
Parameters
- $value : mixed
errorMessage()
Return error message explaining how to configure PHP constant or environmental variables
public
static errorMessage() : string
Return values
stringwriteLn()
Write a line to the console
public
static writeLn([string $format = '' ][, array<string|int, mixed> $args = [] ]) : void
Parameters
- $format : string = ''
- $args : array<string|int, mixed> = []
getValueFromConst()
Return a value from a PHP constant
private
static getValueFromConst(string $key) : string
Parameters
- $key : string
Return values
stringgetValueFromConstOrEnvVar()
Return a value from a PHP constant or environmental variable
private
static getValueFromConstOrEnvVar(string $key) : string
Parameters
- $key : string
Return values
stringgetValueFromEnvVar()
Return a value from an environmental variable
private
static getValueFromEnvVar(string $key) : string
Parameters
- $key : string