Wikibase
MediaWiki Wikibase extension
|
Wrapper around an ItemRevisionMetadataRetriever and ConditionalHeaderUtil to check whether a request meets the preconditions for a certain response code. More...
Public Member Functions | |
__construct (EntityRevisionLookup $revisionLookup, EntityIdParser $entityIdParser, callable $getEntityIdFromRequest, ConditionalHeaderUtil $conditionalHeaderUtil) | |
checkPreconditions (RequestInterface $request) | |
Static Public Member Functions | |
static | getSubjectIdPrefixFromStatementId (string $statementId) |
Convenience function to use with the $getEntityIdFromRequest callable and dealing with statement IDs. More... | |
Private Member Functions | |
getCheckResultFromRequestAndMetadata (RequestInterface $request, int $revisionId, string $revisionTimestamp) | |
Private Attributes | |
EntityRevisionLookup | $revisionLookup |
EntityIdParser | $entityIdParser |
$getEntityIdFromRequest | |
ConditionalHeaderUtil | $conditionalHeaderUtil |
Wrapper around an ItemRevisionMetadataRetriever and ConditionalHeaderUtil to check whether a request meets the preconditions for a certain response code.
Wikibase\Repo\RestApi\RouteHandlers\Middleware\RequestPreconditionCheck::__construct | ( | EntityRevisionLookup | $revisionLookup, |
EntityIdParser | $entityIdParser, | ||
callable | $getEntityIdFromRequest, | ||
ConditionalHeaderUtil | $conditionalHeaderUtil | ||
) |
Wikibase\Repo\RestApi\RouteHandlers\Middleware\RequestPreconditionCheck::checkPreconditions | ( | RequestInterface | $request | ) |
Calling an EntityRevisionLookup directly from the middleware violates the "flow of control" rule as it bypasses the input port and domain layer (see the 4th bullet point in ADR 1). We have made the conscious decision to allow an exception for the following reasons:
|
private |
|
static |
Convenience function to use with the $getEntityIdFromRequest callable and dealing with statement IDs.
|
private |
|
private |
|
private |
|
private |