For example, why not default to a low or mid-range priority and then allow calling $task->priority( 80 ) to change it?
By introducing chainable methods, we could do something like $task->priority( 80 )->retries(3). This allows us to instantiate in a more reader-friendly way and without having to pass null for multiple parameters.
Having 9 parameters to instantiate a
Task
seems a bit much. Do we really need them all in the constructor?https://github.com/newfold-labs/wp-module-tasks/blob/a7d309cd8a693dd82e0c284834cc2b7ee3a8fb12/includes/Models/Data/Task.php#L135-L143
For example, why not default to a low or mid-range priority and then allow calling
$task->priority( 80 )
to change it?By introducing chainable methods, we could do something like
$task->priority( 80 )->retries(3)
. This allows us to instantiate in a more reader-friendly way and without having to pass null for multiple parameters.