deprecatedArgument()
deprecatedArgument(string $function_name, string $release, string $message = null)
Mark a function argument as deprecated and inform when it has been used.
This function is to be used whenever a deprecated function argument is used.
Before this function is called, the argument must be checked for whether it was
used by comparing it to its default value or evaluating whether it is empty.
There is a hook deprecated_argument_run
that will be called that can be used
to get the backtrace up to what file and function used the deprecated
argument.
Default behavior is to trigger a user error if APP_ENV
is set to DEV
.
Example Usage:
$trigger = new TriTan\Common\TriggerError(new TriTan\Common\Context\GlobalContext());
if ( ! empty( $deprecated ) ) {
$trigger->deprecatedArgument( __FUNCTION__, '0.9' );
}
Parameters
string |
$function_name |
The function that was called. |
string |
$release |
The release of TriTan CMS that deprecated the argument used. |
string |
$message |
Optional. A message regarding the change. Default null. |