Skip to content

Commit

Permalink
REST: Add AssertStatementSubjectExists use case step
Browse files Browse the repository at this point in the history
Bug: T342889
Change-Id: I933bdcba896fba2ee88cc7d742189b101a32fa7e
  • Loading branch information
outdooracorn committed Aug 3, 2023
1 parent d925126 commit a3f4998
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php declare( strict_types=1 );

namespace Wikibase\Repo\RestApi\Application\UseCases;

use Wikibase\DataModel\Entity\EntityId;

/**
* @license GPL-2.0-or-later
*/
class AssertStatementSubjectExists {

private GetLatestStatementSubjectRevisionMetadata $getRevisionMetadata;

public function __construct( GetLatestStatementSubjectRevisionMetadata $getRevisionMetadata ) {
$this->getRevisionMetadata = $getRevisionMetadata;
}

/**
* @throws ItemRedirect if the statement subject is a redirect
* @throws UseCaseError if the statement subject does not exist
*/
public function execute( EntityId $id ): void {
$this->getRevisionMetadata->execute( $id );
}

}

0 comments on commit a3f4998

Please sign in to comment.