Skip to content

Commit

Permalink
remove dynamic property creation in presignedurlmiddleware, update re…
Browse files Browse the repository at this point in the history
…flectionproperty in abstractconfig test
  • Loading branch information
Sean O'Brien committed Jan 24, 2024
1 parent e10e5ea commit bb1a6ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/PresignUrlMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static function wrap(
public function __invoke(CommandInterface $cmd, RequestInterface $request = null)
{
if (in_array($cmd->getName(), $this->commandPool)
&& (!isset($cmd->{'__skip' . $cmd->getName()}))
&& (!isset($cmd['__skip' . $cmd->getName()]))
) {
$cmd['DestinationRegion'] = $this->client->getRegion();
if (!empty($cmd['SourceRegion']) && !empty($cmd[$this->presignParam])) {
Expand All @@ -84,7 +84,7 @@ private function createPresignedUrl(
$cmdName = $cmd->getName();
$newCmd = $client->getCommand($cmdName, $cmd->toArray());
// Avoid infinite recursion by flagging the new command.
$newCmd->{'__skip' . $cmdName} = true;
$newCmd['__skip' . $cmdName] = true;

// Serialize a request for the operation.
$request = \Aws\serialize($newCmd);
Expand Down
2 changes: 1 addition & 1 deletion tests/AbstractConfigurationProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function testsPersistsToCache()
// Set interfaceClass property that's normally set by child class
$ref = new \ReflectionClass('\Aws\AbstractConfigurationProvider');
$property = $ref->getProperty('interfaceClass');
$property->setAccessible(true);
$property->setAccessible(null, true);
$property->setValue('\Aws\ResultInterface');

$timesCalled = 0;
Expand Down

0 comments on commit bb1a6ac

Please sign in to comment.