Skip to content

Commit af1f00d

Browse files
authored
bugfix: update deprecated command methods (#2938)
1 parent 3e1cc8f commit af1f00d

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[
2+
{
3+
"type": "bugfix",
4+
"category": "",
5+
"description": "Updates error level on deprecated `Command` methods. Removes suppressed call to deprecated method."
6+
}
7+
]

src/Command.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function setAuthSchemes(array $authSchemes)
7878
trigger_error(__METHOD__ . ' is deprecated. Auth schemes '
7979
. 'resolved using the service `auth` trait or via endpoint resolution '
8080
. 'are now set in the command `@context` property.`'
81-
, E_USER_DEPRECATED
81+
, E_USER_WARNING
8282
);
8383

8484
$this->authSchemes = $authSchemes;
@@ -99,7 +99,7 @@ public function getAuthSchemes()
9999
trigger_error(__METHOD__ . ' is deprecated. Auth schemes '
100100
. 'resolved using the service `auth` trait or via endpoint resolution '
101101
. 'can now be found in the command `@context` property.`'
102-
, E_USER_DEPRECATED
102+
, E_USER_WARNING
103103
);
104104

105105
return $this->authSchemes ?: [];

src/EndpointV2/EndpointV2Middleware.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ private function applyAuthScheme(
231231
): void
232232
{
233233
$authScheme = $this->resolveAuthScheme($authSchemes);
234-
@$command->setAuthSchemes($authScheme);
235234

236235
$command['@context']['signature_version'] = $authScheme['version'];
237236

tests/CommandTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ public function testCanAccessLikeArray()
8686
$this->assertNull($c['boo']);
8787
}
8888

89-
public function testGetAuthSchemesEmitsDeprecationNotice()
89+
public function testGetAuthSchemesEmitsWarning()
9090
{
91-
$this->expectDeprecation(E_USER_DEPRECATED);
92-
$this->expectDeprecationMessage(
91+
$this->expectWarning();
92+
$this->expectWarningMessage(
9393
'Aws\Command::getAuthSchemes is deprecated. Auth schemes resolved using the service'
9494
.' `auth` trait or via endpoint resolution can now be found in the command `@context` property.'
9595
);
@@ -98,10 +98,10 @@ public function testGetAuthSchemesEmitsDeprecationNotice()
9898
$c->getAuthSchemes();
9999
}
100100

101-
public function testSetAuthSchemesEmitsDeprecationNotice()
101+
public function testSetAuthSchemesEmitsWarning()
102102
{
103-
$this->expectDeprecation(E_USER_DEPRECATED);
104-
$this->expectDeprecationMessage(
103+
$this->expectWarning();
104+
$this->expectWarningMessage(
105105
'Aws\Command::setAuthSchemes is deprecated. Auth schemes resolved using the service'
106106
.' `auth` trait or via endpoint resolution are now set in the command `@context` property.'
107107
);

0 commit comments

Comments
 (0)