Skip to content

Commit

Permalink
mend
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean O'Brien committed Jul 17, 2024
1 parent bd544e2 commit e122eaa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/AwsClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,11 @@ protected function isUseEndpointV2()
}

public static function emitDeprecationWarning() {
trigger_error(
"This method is deprecated. It will be removed in an upcoming release."
, E_USER_DEPRECATED
);

$phpVersion = PHP_VERSION_ID;
if ($phpVersion < 70205) {
$phpVersionString = phpversion();
Expand Down
10 changes: 10 additions & 0 deletions tests/AwsClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,16 @@ public function testAppliesConfiguredSignatureVersionViaClientConfig() {
$client->foo();
}

public function testCallingEmitDeprecationWarningEmitsDeprecationWarning()
{
$this->expectDeprecation();
$this->expectDeprecationMessage(
"This method is deprecated. It will be removed in an upcoming release."
);
$client = $this->createClient();
$client::emitDeprecationWarning();
}

private function createHttpsEndpointClient(array $service = [], array $config = [])
{
$apiProvider = function () use ($service) {
Expand Down

0 comments on commit e122eaa

Please sign in to comment.