Avoid injecting the user language into a service. If the service depends on a language, make it part of the parameters when the service is used (possibly indirectly, e.g. via an \IContextSource).
since 7.1. Static DataValue::newFromArray constructors like this are underspecified (not in the DataValue interface), and misleadingly named (should be named newFromArrayValue). Instead, use DataValue builder callbacks in
since 5.1, will be removed in favor of StatementListProvider, which gives the guarantee to return a mutable object. Changes to that object change the entity.
Avoid injecting the user language into a service. If the service depends on a language, make it part of the parameters when the service is used (possibly indirectly, e.g. via an \IContextSource).