Documentation

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
const

REPORTING_CLOUD_API_KEY

BASE_URI

Name of PHP constant or environmental variable storing base URI

public final string BASE_URI = 'REPORTING_CLOUD_BASE_URI'
Tags
const

REPORTING_CLOUD_BASE_URI

Methods

apiKey()

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

public static apiKey() : string
Return values
string

baseUri()

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

public static baseUri() : string
Return values
string

checkCredentials()

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

public static checkCredentials() : bool
Return values
bool

dump()

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
string

writeLn()

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
string

getValueFromConstOrEnvVar()

Return a value from a PHP constant or environmental variable

private static getValueFromConstOrEnvVar(string $key) : string
Parameters
$key : string
Return values
string

getValueFromEnvVar()

Return a value from an environmental variable

private static getValueFromEnvVar(string $key) : string
Parameters
$key : string
Return values
string

        
On this page

Search results