Below is a fragment of one of my functions, but I figured this seemed redundant and thus wanted to avoid it.
function cellMaker($cell){
$label= $cell['label'];
$type= $cell['type'];
$return= $cell['return'];
$size= $cell['size'];
$name= $cell['name'];
$value= $cell['value'];
........
The reason I am doing this is to avoid having to fill in nulls with the function if I only need to pass two of the parameters, like just label and type and value. That would look like cellMaker('how?', 'text' null, null, null, 'because');
Rather I only would need to do cellMaker(["label" => "how?", "type"=> "text", "value" => "because"]) which saves me from having to remember the order the variables are defined in the function and from having to deal with unnecessary variables. However I also do not want to have to type $cell['variable'] rather than $variable each time.
Is there a way to automatically assign all variables of an object to function variables of the same name?
extractfunction.extractfunction is the right answer. I would not advise you to use it as you'll end up with bunch of variable that just appeared from nowhere. That would make debugging and support pain.$cell['label']as is?