// This is the function whose signature will be changed:
function result($a) {
// some code here
}
function showResult($a) {
// Here is the function call:
$this->result($a);
}
// Now we'll rename the function and
// add one parameter.
// The function has been renamed to generateResult.
// The new parameter $b has been added.
function generateResult($a,$b) {
// some code here
}
function showResult($a,$b) {
// The function call has been changed accordingly:
$this->generateResult($a,$b);
}
// This is the function whose signature will be changed:
function result($a) {
// some code here
}
function showResult($a) {
// Here is the function call:
$this->result($a);
}
// Now we'll rename the function and add one parameter.
//We will also specify the default value 'new_param'
//for this new parameter
// The function has been renamed to generateResult.
// The new parameter $b has been added.
function generateResult($a,$b) {
// some code here
}
function showResult($a) {
// The function call has been changed accordingly:
$this->generateResult($a,'new_param');
}
// When performing the refactoring, 'new_param' was specified as
// the default parameter value.
// This is the function whose signature will be changed:
function result($a) {
// some code here
}
function showResult($a) {
// Here is the function call:
$this->result($a);
}
// Now we'll rename the function and add one parameter.
//We will also propagate this new parameter
//through the showResult() calling function to the function call.
// The function has been renamed to generateResult.
// The new parameter $b has been added.
function generateResult($a,$b) {
// some code here
}
// Note the new function parameter:
function showResult($a,$b) {
// The function call has been changed accordingly:
$this->generateResult($a,$b);
}