Reading a possibly-absent array key has meant naming the expression twice — once in isset(), once as the value — which is fine until the expression is $config[‘db’][‘replicas’][0]…
A default export has no name at the boundary, so the importing file invents one. Rename the thing being exported and every import keeps working under the old…
Unpacking a few fields out of an options object is three or four lines of near-identical assignment at the top of every function. Destructuring does it in the…
Walking every day between two dates is usually a while loop with a manual increment and an off-by-one at one end. DatePeriod is an iterator over a start,…