wikimedia/mediawiki-extensions-Wikibase

View on GitHub
lib/includes/Store/TermCacheKeyBuilder.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace Wikibase\Lib\Store;

use Wikibase\DataModel\Entity\EntityId;

/**
 * @license GPL-2.0-or-later
 */
trait TermCacheKeyBuilder {

    public function buildCacheKey( EntityId $id, int $revision, string $language, string $termType ) {
        return str_replace(
            [ '{', '}', '(', ')', '/', '\\', '@', ':' ],
            '_',
            "{$id->getSerialization()}_{$revision}_{$language}_{$termType}"
        );
    }

}