For {T185709}, we cannot just store `Message` objects – the parameters which we pass to our messages contain entity labels, which are already language-specific. We need something more at the `ConstraintParameterRenderer` level: a message object with parameter types like “string”, “entity ID”, “list of item IDs”. Only when the message is finally rendered do we pass those parameters into, say, an `$entityIdLabelFormatter`.
This also means one less object to inject into all checkers: the checkers will instantiate such a message, which is a pure value object, and the task of rendering it is then delayed until the `CheckConstraints` API or `SpecialConstraintReport`, which means that the checkers no longer need a `ConstraintParameterRenderer`.
#patch-for-review:
- [x] [`ViolationMessage`](https://gerrit.wikimedia.org/r/406294)
- [x] [`ViolationMessageRenderer`](https://gerrit.wikimedia.org/r/406295)
- [x] [`ViolationMessage` in `CheckResult`](https://gerrit.wikimedia.org/r/406296)
- [x] [default `null`](https://gerrit.wikimedia.org/r/406297)
- [x] [messages without arguments](https://gerrit.wikimedia.org/r/406298)
- [x] [entity ID arguments](https://gerrit.wikimedia.org/r/406568)
- [x] [messages with such arguments](https://gerrit.wikimedia.org/r/406569)
- [x] [entity ID list arguments](https://gerrit.wikimedia.org/r/406834)
- [x] [messages with such arguments](https://gerrit.wikimedia.org/r/406835)
- [x] minor test changes [1](https://gerrit.wikimedia.org/r/406991), [2](https://gerrit.wikimedia.org/r/406992), [3](https://gerrit.wikimedia.org/r/406993)
- [x] [`ItemIdSnakValue` arguments](https://gerrit.wikimedia.org/r/406994)
- [x] [messages with such arguments](https://gerrit.wikimedia.org/r/407000)
- [x] [minor: remove unused parameters](https://gerrit.wikimedia.org/r/407001)
- [x] [`ItemIdSnakValue` list arguments](https://gerrit.wikimedia.org/r/407008)
- [x] prior [refactoring](https://gerrit.wikimedia.org/r/407007)
- [x] [messages with such arguments](https://gerrit.wikimedia.org/r/407009)
- [x] [data value type arguments](https://gerrit.wikimedia.org/r/407012)
- [x] [messages with such arguments](https://gerrit.wikimedia.org/r/407013)
- [x] me being stupid: [1](https://gerrit.wikimedia.org/r/407033), [2](https://gerrit.wikimedia.org/r/407037)
- [x] [data value arguments](https://gerrit.wikimedia.org/r/407035)
- [x] prior [injection](https://gerrit.wikimedia.org/r/407034)
- [x] [messages with such arguments](https://gerrit.wikimedia.org/r/407036)
- [x] [extra test](https://gerrit.wikimedia.org/r/407044)
- [x] [inline code arguments](https://gerrit.wikimedia.org/r/407653)
- [x] `ViolationMessageRenderer` refactorings [1](https://gerrit.wikimedia.org/r/407654), [2](https://gerrit.wikimedia.org/r/407655)
- [ ] [multilingual text arguments](https://gerrit.wikimedia.org/r/407656)
- [ ] [messages with such arguments](https://gerrit.wikimedia.org/r/407657)
- [ ] [constraint scope arguments](https://gerrit.wikimedia.org/r/407708)
- [ ] prior [refactoring](https://gerrit.wikimedia.org/r/407707)
- [ ] [constraint scope list arguments](https://gerrit.wikimedia.org/r/407709)
- [ ] [language arguments](https://gerrit.wikimedia.org/r/407710)
- [ ] [`ViolationMessageRenderer` improvements](https://gerrit.wikimedia.org/r/408544)
Left to do:
- {T185999}
- //after that//, use `ViolationMessage` in `ConstraintParameterException`. Requires s11n because `SparqlHelper` serializes and deserializes CPEs in the regex cache.
- remove support for plain `string` messages from `ViolationMessageRenderer`
- remove most of `ConstraintParameterRenderer`
- remove injected `ConstraintParameterRenderer` from checkers and helpers (at this point, it might be interesting to check the `git diff --stat 407387c src/`)