Skip to content

Commit

Permalink
Merge pull request aws#688 from jeskew/fix/circular-ref-in-s3client
Browse files Browse the repository at this point in the history
Unbind middleware closures from $this
  • Loading branch information
jeskew committed Jul 14, 2015
2 parents fb6037d + 930e141 commit 3f5843f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/S3/S3Client.php
Expand Up @@ -430,10 +430,10 @@ private function checkExistenceWithCommand(CommandInterface $command)
*/
private function getLocationConstraintMiddleware()
{
return function (callable $handler) {
return function (Command $command, $request = null) use ($handler) {
$region = $this->getRegion();
return static function (callable $handler) use ($region) {
return function (Command $command, $request = null) use ($handler, $region) {
if ($command->getName() === 'CreateBucket') {
$region = $this->getRegion();
if ($region === 'us-east-1') {
unset($command['CreateBucketConfiguration']);
} else {
Expand All @@ -453,7 +453,7 @@ private function getLocationConstraintMiddleware()
*/
private function getSaveAsParameter()
{
return function (callable $handler) {
return static function (callable $handler) {
return function (Command $command, $request = null) use ($handler) {
if ($command->getName() === 'GetObject' && isset($command['SaveAs'])) {
$command['@http']['sink'] = $command['SaveAs'];
Expand Down

0 comments on commit 3f5843f

Please sign in to comment.