4.2.40. Rename Parameter¶
Change the name of a parameter to a new name.
The destination parameter name is a constant. Suggestions : rename all parameters from the top method (in classes) rename parameters $a into $b (currently, no $a available)
Limits : this cobbler doesn’t check that another parameter is already using that name, nor if a local variable is also using that name. This may lead to unexpected results.
4.2.40.1. Before¶
<?php
foo(a: 1);
function foo($a) {
return $a;
}
?>
4.2.40.2. After¶
<?php
foo(b: 1);
function foo($b) {
return $b;
}
?>
4.2.40.3. Parameters¶
Name |
Default |
Type |
Description |
oldName |
$A |
string |
The original name of the parameter. |
newName |
$B |
string |
The new name of the parameter. |
method |
string |
The name of the target method. Use a full qualified name for a function, and the class name::method for methods. |
4.2.40.4. Specs¶
Short Name |
Functions/RenameParameter |
Exakat version |
2.3.0 |
Available in |