For many of my objects, I’m passing in other object dependencies along with variables (strings, integers or arrays). Is there a “best practice” order to pass these into an object? For example, is it better to pass in the variables first, then the objects like this:
function __construct($list, Database $db, Widget $widget)
Or is it better to pass the dependency objects first like this:
function __construct(Database $db, Widget $widget, $list)
Or does it not matter at all, and it’s just a personal preference?