list of (DB key, DB key without code)) */ private $replacements = []; /** * @param string $code Language code * @param string $title Message cache key with initial uppercase letter * @param string $msg Message cache key with initial uppercase letter and without the code */ public function __construct( $code, $title, $msg ) { $this->replacements[$code][] = [ $title, $msg ]; } public function merge( MergeableUpdate $update ) { /** @var self $update */ Assert::parameterType( __CLASS__, $update, '$update' ); '@phan-var self $update'; foreach ( $update->replacements as $code => $messages ) { $this->replacements[$code] = array_merge( $this->replacements[$code] ?? [], $messages ); } } public function doUpdate() { $messageCache = MessageCache::singleton(); foreach ( $this->replacements as $code => $replacements ) { $messageCache->refreshAndReplaceInternal( $code, $replacements ); } } }