Skip to content

Commit

Permalink
refactor: Use 'never' return type
Browse files Browse the repository at this point in the history
  • Loading branch information
tienvx committed Oct 10, 2024
1 parent e206999 commit e34a27b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion compatibility-suite/public/provider-states/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

$app->post('/pact-change-state', $stateChangeHandler);

$app->post('/failed-pact-change-state', function (ServerRequestInterface $request) use ($stateChangeHandler): void {
$app->post('/failed-pact-change-state', function (ServerRequestInterface $request) use ($stateChangeHandler): never {
$stateChangeHandler($request);

throw new \Exception('Cant do it');
Expand Down
6 changes: 3 additions & 3 deletions compatibility-suite/tests/Context/V1/Http/ProviderContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,23 +121,23 @@ public function aPactFileForInteractionIsToBeVerifiedWithAProviderStateDefined(i
/**
* @Then a warning will be displayed that there was no provider state callback configured for provider state :state
*/
public function aWarningWillBeDisplayedThatThereWasNoProviderStateCallbackConfiguredForProviderState(string $state): void
public function aWarningWillBeDisplayedThatThereWasNoProviderStateCallbackConfiguredForProviderState(string $state): never
{
throw new PendingException("Unable to verify this, as I can't find a way to assert this message from verifier's log: 'pact_verifier::callback_executors: State Change ignored as there is no state change URL provided for interaction'");
}

/**
* @Given a request filter is configured to make the following changes:
*/
public function aRequestFilterIsConfiguredToMakeTheFollowingChanges(TableNode $table): void
public function aRequestFilterIsConfiguredToMakeTheFollowingChanges(TableNode $table): never
{
throw new PendingException("Unable to set request filter callback from ffi");
}

/**
* @Then the request to the provider will contain the header :header
*/
public function theRequestToTheProviderWillContainTheHeader(string $header): void
public function theRequestToTheProviderWillContainTheHeader(string $header): never
{
throw new PendingException('Unable to set request filter callback from ffi, so no need to implement this step');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,23 @@ public function theFirstInteractionInThePactFileWillHave(string $name, string $v
/**
* @Given the message request payload contains the :fixture JSON document
*/
public function theMessageRequestPayloadContainsTheJsonDocument(string $fixture): void
public function theMessageRequestPayloadContainsTheJsonDocument(string $fixture): never
{
throw new PendingException("Can't set sync message's request payload using FFI call");
}

/**
* @Given the message response payload contains the :fixture document
*/
public function theMessageResponsePayloadContainsTheDocument(string $fixture): void
public function theMessageResponsePayloadContainsTheDocument(string $fixture): never
{
throw new PendingException("Can't set sync message's response payload using FFI call");
}

/**
* @Then the received message payload will contain the :fixture document
*/
public function theReceivedMessagePayloadWillContainTheDocument(string $fixture): void
public function theReceivedMessagePayloadWillContainTheDocument(string $fixture): never
{
throw new PendingException('Implement previous pending step first');
}
Expand All @@ -125,79 +125,79 @@ public function thePactFileWillContainInteraction(int $num): void
/**
* @Then the first interaction in the pact file will contain the :fixture document as the request
*/
public function theFirstInteractionInThePactFileWillContainTheDocumentAsTheRequest(string $fixture): void
public function theFirstInteractionInThePactFileWillContainTheDocumentAsTheRequest(string $fixture): never
{
throw new PendingException('Implement previous pending step first');
}

/**
* @Then the first interaction in the pact file request content type will be :contentType
*/
public function theFirstInteractionInThePactFileRequestContentTypeWillBe(string $contentType): void
public function theFirstInteractionInThePactFileRequestContentTypeWillBe(string $contentType): never
{
throw new PendingException('Implement previous pending step first');
}

/**
* @Then the first interaction in the pact file will contain the :fixture document as a response
*/
public function theFirstInteractionInThePactFileWillContainTheDocumentAsAResponse(string $fixture): void
public function theFirstInteractionInThePactFileWillContainTheDocumentAsAResponse(string $fixture): never
{
throw new PendingException('Implement previous pending step first');
}

/**
* @Then the first interaction in the pact file response content type will be :contentType
*/
public function theFirstInteractionInThePactFileResponseContentTypeWillBe(string $contentType): void
public function theFirstInteractionInThePactFileResponseContentTypeWillBe(string $contentType): never
{
throw new PendingException('Implement previous pending step first');
}

/**
* @Then the first interaction in the pact file will contain :num response messages
*/
public function theFirstInteractionInThePactFileWillContainResponseMessages(int $num): void
public function theFirstInteractionInThePactFileWillContainResponseMessages(int $num): never
{
throw new PendingException('Implement previous pending step first');
}

/**
* @Then the first interaction in the pact file will contain the :fixture document as the first response message
*/
public function theFirstInteractionInThePactFileWillContainTheDocumentAsTheFirstResponseMessage(string $fixture): void
public function theFirstInteractionInThePactFileWillContainTheDocumentAsTheFirstResponseMessage(string $fixture): never
{
throw new PendingException('Implement previous pending step first');
}

/**
* @Then the first interaction in the pact file will contain the :fixture document as the second response message
*/
public function theFirstInteractionInThePactFileWillContainTheDocumentAsTheSecondResponseMessage(string $fixture): void
public function theFirstInteractionInThePactFileWillContainTheDocumentAsTheSecondResponseMessage(string $fixture): never
{
throw new PendingException('Implement previous pending step first');
}

/**
* @Given the message request contains the following metadata:
*/
public function theMessageRequestContainsTheFollowingMetadata(TableNode $table): void
public function theMessageRequestContainsTheFollowingMetadata(TableNode $table): never
{
throw new PendingException("Can't set sync message's metadata using FFI call");
}

/**
* @Then /^the received message request metadata will contain "([^"]+)" == "(.+)"$/
*/
public function theReceivedMessageRequestMetadataWillContain(string $key, string $value): void
public function theReceivedMessageRequestMetadataWillContain(string $key, string $value): never
{
throw new PendingException('Implement previous pending step first');
}

/**
* @Then /^the first message in the pact file will contain the request message metadata "([^"]+)" == "(.+)"$/
*/
public function theFirstMessageInThePactFileWillContainTheRequestMessageMetadata(string $key, string $value): void
public function theFirstMessageInThePactFileWillContainTheRequestMessageMetadata(string $key, string $value): never
{
throw new PendingException('Implement previous pending step first');
}
Expand Down Expand Up @@ -252,55 +252,55 @@ public function theProviderStateForTheMessageWillContainTheFollowingParameters(s
/**
* @Given the message request is configured with the following:
*/
public function theMessageRequestIsConfiguredWithTheFollowing(TableNode $table): void
public function theMessageRequestIsConfiguredWithTheFollowing(TableNode $table): never
{
throw new PendingException("Can't set sync message's request generators using FFI call");
}

/**
* @Given the message response is configured with the following:
*/
public function theMessageResponseIsConfiguredWithTheFollowing(TableNode $table): void
public function theMessageResponseIsConfiguredWithTheFollowing(TableNode $table): never
{
throw new PendingException("Can't set sync message's response generators using FFI call");
}

/**
* @Then the message request contents for :path will have been replaced with a(n) :type
*/
public function theMessageRequestContentsForWillHaveBeenReplacedWithAn(string $path, string $type): void
public function theMessageRequestContentsForWillHaveBeenReplacedWithAn(string $path, string $type): never
{
throw new PendingException('Implement previous pending step first');
}

/**
* @Then the message response contents for :path will have been replaced with a(n) :type
*/
public function theMessageResponseContentsForWillHaveBeenReplacedWithAn(string $path, string $type): void
public function theMessageResponseContentsForWillHaveBeenReplacedWithAn(string $path, string $type): never
{
throw new PendingException('Implement previous pending step first');
}

/**
* @Then the received message request metadata will contain :key replaced with a(n) :type
*/
public function theReceivedMessageRequestMetadataWillContainReplacedWithAn(string $key, string $type): void
public function theReceivedMessageRequestMetadataWillContainReplacedWithAn(string $key, string $type): never
{
throw new PendingException('Implement previous pending step first');
}

/**
* @Then the received message response metadata will contain :key == :value
*/
public function theReceivedMessageResponseMetadataWillContain(string $key, string $value): void
public function theReceivedMessageResponseMetadataWillContain(string $key, string $value): never
{
throw new PendingException('Implement previous pending step first');
}

/**
* @Then the received message response metadata will contain :key replaced with an :type
*/
public function theReceivedMessageResponseMetadataWillContainReplacedWithAn(string $key, string $type): void
public function theReceivedMessageResponseMetadataWillContainReplacedWithAn(string $key, string $type): never
{
throw new PendingException('Implement previous pending step first');
}
Expand All @@ -316,15 +316,15 @@ public function theMessageIsSuccessfullyProcessed(): void
/**
* @Then the consumer test will have passed
*/
public function theConsumerTestWillHavePassed(): void
public function theConsumerTestWillHavePassed(): never
{
throw new PendingException('Implement previous pending step first');
}

/**
* @Then the received message content type will be :contentType
*/
public function theReceivedMessageContentTypeWillBe(string $contentType): void
public function theReceivedMessageContentTypeWillBe(string $contentType): never
{
throw new PendingException('Implement previous pending step first');
}
Expand Down

0 comments on commit e34a27b

Please sign in to comment.