Phalcon 4 made changes to how CLI task actions accept parameters. In previous versions of Phalcon, parameters would come as an array of parameters.
public function testAction(array $params)
{
//
}
We modified our CLI bootstrap code to look for flags so we could call our task like this:
php cli.php task action --param1 value1 --param2 value2 --param4 value4
Our action would then get an array of params that looks like this:
[
'param1' => 'value1',
'param2' => 'value2',
'param4' => 'value4',
]
This way, we could add optional paramaters (like param3 in the above example) to our task actions.
In Phalcon4, parameters are sent to the task actions individually and having optional parameters appears to be impossible. Lets say I have a a task action that has four params, two of them optional.
public function testAction($param1, $param2, $param3 = null, $param4 = null)
{
//
}
How would I call this task using param1, param2, and param4 and not using the optional param3? In all our tests, doing this sends the value of param4 to the $param3 variable.