Functions

Remove and blank strings from the given array.

_cleanup_array(array $in) : array

Parameters

$in

array

List of strings

Returns

arrayList of strings, with blank strings removed

Throw out a type checker error message.

_fail_php_type_check(string $type, string $function_name, string $name, string $value, boolean $echo) 

Parameters

$type

string

The type involved

$function_name

string

The function involved

$name

string

The parameter name involved

$value

string

The value involved

$echo

boolean

Whether we just echo errors instead of exiting

Read a PHP function line and return parsed details.

_read_php_function_line(string $_line) : array

Parameters

$_line

string

The line

Returns

arrayA pair: (function name, parameters), where parameters is a list of maps detailing each parameter

Type-check the specified parameter (giving an error if the type checking fails) [all checks]

check_function_type(\ID_TEXT $type, string $function_name, string $name, \?mixed $value, \?string $range, \?string $set, boolean $echo) 

Parameters

$type

\ID_TEXT

The parameter type

$function_name

string

The functions name (used in error message)

$name

string

The parameter name (used in error message)

$value

\?mixed

The parameters value (NULL: value actually is null)

$range

\?string

The string of value range of the parameter (NULL: no range constraint)

$set

\?string

The string of value set limitation for the parameter (NULL: no set constraint)

$echo

boolean

Whether we just echo errors instead of exiting

Get a complex API information structure from a PHP file.

get_php_file_api(\ID_TEXT $filename, boolean $include_code) : array

It assumes the file has reasonably properly layed out class and function whitespace The return structure is... list of classes each entry is a map containing 'functions' (list of functions) and 'name' each functions entry is a map containing 'parameters' and 'name' and 'return' each parameters entry is a map containing... name description type default set range

Parameters

$filename

\ID_TEXT

The PHP code module to get API information for

$include_code

boolean

Whether to include function source code

Returns

arrayThe complex structure of API information

Standard code module initialisation function.

init__php() 

Render a PHP function to display in a template.

render_php_function(array $function, array $class, boolean $show_filename) : array

Parameters

$function

array

The map of function information

$class

array

The map of class information

$show_filename

boolean

Show filenames in the function description

Returns

arrayA pair: The rendered function, The rendered summary (for a TOC)

Get a PHP function parameter line.

render_php_function_do_bits(array $parameter) : \tempcode

Parameters

$parameter

array

A map containing: name, description, default, type, set, range

Returns

\tempcodeThe line

Type-check the specified parameter (giving an error if the type checking fails) [just value against type]

test_fail_php_type_check(\ID_TEXT $type, string $function_name, string $name, mixed $value, boolean $echo) 

Parameters

$type

\ID_TEXT

The parameter type

$function_name

string

The functions name (used in error message)

$name

string

The parameter name (used in error message)

$value

mixed

The parameters value (cannot be null)

$echo

boolean

Whether we just echo errors instead of exiting