wikimedia/mediawiki-extensions-Wikibase

View on GitHub
repo/includes/FederatedProperties/WrappingEntityIdFormatterFactory.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

declare( strict_types = 1 );

namespace Wikibase\Repo\FederatedProperties;

use MediaWiki\Language\Language;
use Wikibase\View\EntityIdFormatterFactory;

/**
 * @license GPL-2.0-or-later
 * @author Addshore
 */
class WrappingEntityIdFormatterFactory implements EntityIdFormatterFactory {

    /** @var EntityIdFormatterFactory */
    private $inner;

    public function __construct( EntityIdFormatterFactory $inner ) {
        $this->inner = $inner;
    }

    public function getOutputFormat() {
        return $this->inner->getOutputFormat();
    }

    public function getEntityIdFormatter( Language $language ) {
        return new FederatedPropertiesEntityIdFormatter(
            $this->inner->getEntityIdFormatter( $language )
        );
    }

}