PrintingFunctionsTrait
Helper functions and function lists for checking whether a function prints output.
Any sniff class which incorporates this trait will automatically support the
following public property which can be changed from within a custom ruleset:
customPrintingFunctions.
Tags
Table of Contents
Properties
- $customPrintingFunctions : array<string|int, string>
- Custom list of functions which print output incorporating the passed values.
- $addedCustomPrintingFunctions : array<string|int, string>
- Cache of previously added custom functions.
- $allPrintingFunctions : array<string, bool>
- Combined list of WP/PHP native and custom printing functions.
- $printingFunctions : array<string, bool>
- Functions which print output incorporating the values passed to them.
Methods
- get_printing_functions() : array<string, bool>
- Retrieve a list of all known printing functions.
- is_printing_function() : bool
- Check if a particular function is regarded as a printing function.
Properties
$customPrintingFunctions
Custom list of functions which print output incorporating the passed values.
public
array<string|int, string>
$customPrintingFunctions
= array()
Tags
$addedCustomPrintingFunctions
Cache of previously added custom functions.
private
array<string|int, string>
$addedCustomPrintingFunctions
= array()
Prevents having to do the same merges over and over again.
Tags
$allPrintingFunctions
Combined list of WP/PHP native and custom printing functions.
private
array<string, bool>
$allPrintingFunctions
= array()
Tags
$printingFunctions
Functions which print output incorporating the values passed to them.
private
array<string, bool>
$printingFunctions
= array('_deprecated_argument' => true, '_deprecated_constructor' => true, '_deprecated_file' => true, '_deprecated_function' => true, '_deprecated_hook' => true, '_doing_it_wrong' => true, '_e' => true, '_ex' => true, 'printf' => true, 'trigger_error' => true, 'user_error' => true, 'vprintf' => true, 'wp_die' => true, 'wp_dropdown_pages' => true)
Tags
Methods
get_printing_functions()
Retrieve a list of all known printing functions.
public
final get_printing_functions() : array<string, bool>
Tags
Return values
array<string, bool>is_printing_function()
Check if a particular function is regarded as a printing function.
public
final is_printing_function(string $functionName) : bool
Parameters
- $functionName : string
-
The name of the function to check.