Named arguments into a constructor with nine parameters

A report query object with nine constructor parameters, six of them nullable, called from four places with different subsets.

// before: positional, and unreadable
new ReportQuery($from, $to, null, null, 'gbp', null, true, null, 50);

// after
new ReportQuery(
    from: $from,
    to: $to,
    currency: 'gbp',
    includeRefunds: true,
    limit: 50,
);

Named arguments make the nine-parameter constructor tolerable, and tolerable is the problem — the call site now reads well enough that nobody feels the pressure to fix the design. The honest version of this note is that it bought us six months before splitting the object into a filter and a pagination value, and the parameter names became a public API in the meantime: renaming one is a breaking change now, which it was not before.