1.2.1033. Relay Function

Relay function only delegates workload to another one.

Relay functions and methods are delegating the actual work to another function or method. They do not have any impact on the results, besides exposing another name for the same feature. Relay functions are typical of transition API, where an old API have to be preserved until it is fully migrated. Then, they may be removed, so as to reduce confusion, and simplify the API.

<?php

function myStrtolower($string) {
    return \strtolower($string);
}

?>

1.2.1033.1. Suggestions

  • Remove relay function, call directly the final function

  • Remove the target function, and move the code here

  • Add more logic to that function, like conditions or cache

1.2.1033.2. Specs

Short name

Functions/RelayFunction

Rulesets

All, Inventory

Exakat since

0.8.4

PHP Version

All

Severity

Major

Time To Fix

Quick (30 mins)

Precision

Very high

Features

function

Examples

TeamPass, SPIP

Available in

Entreprise Edition, Exakat Cloud