wikimedia/mediawiki-extensions-Wikibase

View on GitHub
lib/packages/wikibase/data-model-services/src/Diff/EntityDifferStrategy.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace Wikibase\DataModel\Services\Diff;

use InvalidArgumentException;
use Wikibase\DataModel\Entity\EntityDocument;

/**
 * @since 1.0
 *
 * @license GPL-2.0-or-later
 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
 */
interface EntityDifferStrategy {

    /**
     * @param string $entityType
     *
     * @return bool
     */
    public function canDiffEntityType( $entityType );

    /**
     * @param EntityDocument $from
     * @param EntityDocument $to
     *
     * @return EntityDiff
     * @throws InvalidArgumentException
     */
    public function diffEntities( EntityDocument $from, EntityDocument $to );

    /**
     * @param EntityDocument $entity
     *
     * @return EntityDiff
     * @throws InvalidArgumentException
     */
    public function getConstructionDiff( EntityDocument $entity );

    /**
     * @param EntityDocument $entity
     *
     * @return EntityDiff
     * @throws InvalidArgumentException
     */
    public function getDestructionDiff( EntityDocument $entity );

}