Commit graph

3 commits

Author SHA1 Message Date
Tim Starling
0077c5da15 Use short array destructuring instead of list()
Introduced in PHP 7.1. Because it's shorter and looks nice.

I used regex replacement.

Change-Id: I0555e199d126cd44501f859cb4589f8bd49694da
2022-10-21 15:33:37 +11:00
James D. Forrester
b83a3e3e3a Follow-up Ifa346c8a92: LanguageNameUtils: CONSTRUCTOR_OTPIONS, not constructorOptions
Change-Id: I357dddf39834e9eed4b173245033d2f27edab329
2019-10-10 17:01:49 -07:00
Aryeh Gregor
b058a0e562 Test that classes use all their ServiceOptions
Classes that use ServiceOptions need to declare a list of keys that they
use, typically in self::$constructorOptions. If keys are missing from
that list that are supposed to be present, an exception will be thrown
when someone tries to access them. If keys are present on the list that
are never used, no error is flagged. This means if a dependency on a
given configuration option is removed and nobody updates the list, the
service will keep thinking it depends on that option when it doesn't.
This is messy at best, like an unused variable.

A new and easy-to-use TestAllServiceOptionsUsed trait fixes that
problem. It will log all the ServiceOptions accesses while the test
class runs and raise an error if there are any keys that were never
accessed.

In retrospect, it was probably not worth the time to write this, but
it's a sunk cost now.

Change-Id: Idcaf9a0e2f687069869e6f8057908ffee7dd5f11
2019-08-19 20:42:28 +03:00