From b4d9605bdc9268c4c4adb88730f3a6864314146e Mon Sep 17 00:00:00 2001 From: frostealth Date: Sat, 8 Oct 2016 00:17:22 +0600 Subject: [PATCH] refactoring of commands. now they are semantic --- README.md | 22 ++--- src/CommandBuilder.php | 4 +- src/CommandFactory.php | 16 ++-- src/base/commands/traits/Options.php | 8 +- src/commands/DeleteCommand.php | 14 ++- src/commands/ExistCommand.php | 14 +-- src/commands/GetCommand.php | 14 ++- src/commands/GetPresignedUrlCommand.php | 22 +++-- src/commands/GetUrlCommand.php | 12 +-- src/commands/PutCommand.php | 24 +++-- src/commands/RestoreCommand.php | 18 ++-- src/commands/UploadCommand.php | 92 ++++++++----------- .../GetPresignedUrlCommandHandler.php | 2 +- src/handlers/PlainCommandHandler.php | 4 +- src/handlers/UploadCommandHandler.php | 8 +- src/interfaces/commands/HasAcl.php | 2 +- src/interfaces/commands/HasBucket.php | 4 +- 17 files changed, 142 insertions(+), 138 deletions(-) diff --git a/README.md b/README.md index 8e04df4..ede7a75 100644 --- a/README.md +++ b/README.md @@ -49,11 +49,11 @@ $s3 = Yii::$app->get('s3'); /** @var \Aws\ResultInterface $result */ $result = $s3->commands()->get('filename.ext')->saveAs('/path/to/local/file.ext')->execute(); -$result = $s3->commands()->put('filename.ext', 'body')->setContentType('text/plain')->execute(); +$result = $s3->commands()->put('filename.ext', 'body')->withContentType('text/plain')->execute(); $result = $s3->commands()->delete('filename.ext')->execute(); -$result = $s3->commands()->upload('filename.ext', '/path/to/local/file.ext')->setAcl('private')->execute(); +$result = $s3->commands()->upload('filename.ext', '/path/to/local/file.ext')->withAcl('private')->execute(); $result = $s3->commands()->restore('filename.ext', $days = 7)->execute(); @@ -118,7 +118,7 @@ $s3 = Yii::$app->get('s3'); /** @var \frostealth\yii2\aws\s3\commands\GetCommand $command */ $command = $s3->create(GetCommand::class); -$command->setBucket('my-another-bucket')->setFilename('filename.ext')->saveAs('/path/to/local/file.ext'); +$command->inBucket('my-another-bucket')->byFilename('filename.ext')->saveAs('/path/to/local/file.ext'); /** @var \Aws\ResultInterface $result */ $result = $s3->execute($command); @@ -169,7 +169,7 @@ class MyCommand implements Command, HasBucket return $this->bucket; } - public function setBucket(string $bucket) + public function inBucket(string $bucket) { $this->bucket = $bucket; @@ -181,7 +181,7 @@ class MyCommand implements Command, HasBucket return $this->something; } - public function setSomething(string $something) + public function withSomething(string $something) { $this->something = $something; @@ -221,7 +221,7 @@ $s3 = Yii::$app->get('s3'); /** @var \app\components\s3\commands\MyCommand $command */ $command = $s3->create(MyCommand::class); -$command->setSomething('some value')->setOption('OptionName', 'value'); +$command->withSomething('some value')->withOption('OptionName', 'value'); /** @var \Aws\ResultInterface $result */ $result = $s3->execute($command); @@ -234,8 +234,8 @@ Custom plain command looks like this: namespace app\components\s3\commands; -use frostealth\yii2\aws\s3\interfaces\HasBucket; -use frostealth\yii2\aws\s3\interfaces\PlainCommand; +use frostealth\yii2\aws\s3\interfaces\commands\HasBucket; +use frostealth\yii2\aws\s3\interfaces\commands\PlainCommand; class MyPlainCommand implements PlainCommand, HasBucket { @@ -246,7 +246,7 @@ class MyPlainCommand implements PlainCommand, HasBucket return $this->args['Bucket'] ?? ''; } - public function setBucket(string $bucket) + public function inBucket(string $bucket) { $this->args['Bucket'] = $bucket; @@ -258,7 +258,7 @@ class MyPlainCommand implements PlainCommand, HasBucket return $this->args['something'] ?? ''; } - public function setSomething($something) + public function withSomething($something) { $this->args['something'] = $something; @@ -278,7 +278,7 @@ class MyPlainCommand implements PlainCommand, HasBucket ``` Any command can extend the `ExecutableCommand` class or implement the `Executable` interface that will -allow to execute this command immediately: `$command->setSomething('some value')->execute();`. +allow to execute this command immediately: `$command->withSomething('some value')->execute();`. ## License diff --git a/src/CommandBuilder.php b/src/CommandBuilder.php index ed0c067..0fa21d0 100644 --- a/src/CommandBuilder.php +++ b/src/CommandBuilder.php @@ -58,11 +58,11 @@ class CommandBuilder implements interfaces\CommandBuilder protected function prepareCommand(interfaces\commands\Command $command) { if ($command instanceof interfaces\commands\HasBucket) { - $command->setBucket($this->bucket); + $command->inBucket($this->bucket); } if ($command instanceof interfaces\commands\HasAcl) { - $command->setAcl($this->acl); + $command->withAcl($this->acl); } } } diff --git a/src/CommandFactory.php b/src/CommandFactory.php index a218b05..d734591 100644 --- a/src/CommandFactory.php +++ b/src/CommandFactory.php @@ -41,7 +41,7 @@ class CommandFactory { /** @var GetCommand $command */ $command = $this->builder->build(GetCommand::class); - $command->setFilename($filename); + $command->byFilename($filename); return $command; } @@ -56,7 +56,7 @@ class CommandFactory { /** @var PutCommand $command */ $command = $this->builder->build(PutCommand::class); - $command->setFilename($filename)->setBody($body); + $command->withFilename($filename)->withBody($body); return $command; } @@ -70,7 +70,7 @@ class CommandFactory { /** @var DeleteCommand $command */ $command = $this->builder->build(DeleteCommand::class); - $command->setFilename($filename); + $command->byFilename($filename); return $command; } @@ -85,7 +85,7 @@ class CommandFactory { /** @var UploadCommand $command */ $command = $this->builder->build(UploadCommand::class); - $command->setFilename($filename)->setSource($source); + $command->withFilename($filename)->withSource($source); return $command; } @@ -100,7 +100,7 @@ class CommandFactory { /** @var RestoreCommand $command */ $command = $this->builder->build(RestoreCommand::class); - $command->setFilename($filename)->setDays($days); + $command->byFilename($filename)->withLifetime($days); return $command; } @@ -114,7 +114,7 @@ class CommandFactory { /** @var ExistCommand $command */ $command = $this->builder->build(ExistCommand::class); - $command->setFilename($filename); + $command->byFilename($filename); return $command; } @@ -128,7 +128,7 @@ class CommandFactory { /** @var GetUrlCommand $command */ $command = $this->builder->build(GetUrlCommand::class); - $command->setFilename($filename); + $command->byFilename($filename); return $command; } @@ -143,7 +143,7 @@ class CommandFactory { /** @var GetPresignedUrlCommand $command */ $command = $this->builder->build(GetPresignedUrlCommand::class); - $command->setFilename($filename)->setExpires($expires); + $command->byFilename($filename)->withExpiration($expires); return $command; } diff --git a/src/base/commands/traits/Options.php b/src/base/commands/traits/Options.php index 4dca597..ef33de9 100644 --- a/src/base/commands/traits/Options.php +++ b/src/base/commands/traits/Options.php @@ -17,10 +17,10 @@ trait Options * * @return $this */ - final public function setOptions(array $value) + final public function withOptions(array $value) { $this->options = $value; - + return $this; } @@ -38,10 +38,10 @@ trait Options * * @return $this */ - final public function setOption(string $name, $value) + final public function withOption(string $name, $value) { $this->options[$name] = $value; - + return $this; } } diff --git a/src/commands/DeleteCommand.php b/src/commands/DeleteCommand.php index 7c09dd5..c09a51f 100644 --- a/src/commands/DeleteCommand.php +++ b/src/commands/DeleteCommand.php @@ -35,13 +35,13 @@ class DeleteCommand extends ExecutableCommand implements PlainCommand, HasBucket } /** - * @param string $bucket + * @param string $name * * @return $this */ - public function setBucket(string $bucket) + public function inBucket(string $name) { - $this->args['Bucket'] = $bucket; + $this->args['Bucket'] = $name; return $this; } @@ -59,7 +59,7 @@ class DeleteCommand extends ExecutableCommand implements PlainCommand, HasBucket * * @return $this */ - public function setFilename(string $filename) + public function byFilename(string $filename) { $this->args['Key'] = $filename; @@ -79,7 +79,7 @@ class DeleteCommand extends ExecutableCommand implements PlainCommand, HasBucket * * @return $this */ - public function setVersionId(string $versionId) + public function withVersionId(string $versionId) { $this->args['VersionId'] = $versionId; @@ -87,6 +87,8 @@ class DeleteCommand extends ExecutableCommand implements PlainCommand, HasBucket } /** + * @internal used by the handlers + * * @return string */ public function getName(): string @@ -95,6 +97,8 @@ class DeleteCommand extends ExecutableCommand implements PlainCommand, HasBucket } /** + * @internal used by the handlers + * * @return array */ public function toArgs(): array diff --git a/src/commands/ExistCommand.php b/src/commands/ExistCommand.php index 6ce657e..97803b9 100644 --- a/src/commands/ExistCommand.php +++ b/src/commands/ExistCommand.php @@ -16,7 +16,7 @@ use frostealth\yii2\aws\s3\interfaces\commands\HasBucket; class ExistCommand extends ExecutableCommand implements HasBucket { use Options; - + /** @var string */ protected $bucket; @@ -32,14 +32,14 @@ class ExistCommand extends ExecutableCommand implements HasBucket } /** - * @param string $bucket + * @param string $name * * @return $this */ - public function setBucket(string $bucket) + public function inBucket(string $name) { - $this->bucket = $bucket; - + $this->bucket = $name; + return $this; } @@ -56,10 +56,10 @@ class ExistCommand extends ExecutableCommand implements HasBucket * * @return $this */ - public function setFilename(string $filename) + public function byFilename(string $filename) { $this->filename = $filename; - + return $this; } } diff --git a/src/commands/GetCommand.php b/src/commands/GetCommand.php index 1881c68..b037160 100644 --- a/src/commands/GetCommand.php +++ b/src/commands/GetCommand.php @@ -35,13 +35,13 @@ class GetCommand extends ExecutableCommand implements PlainCommand, HasBucket, A } /** - * @param string $bucket + * @param string $name * * @return $this */ - public function setBucket(string $bucket) + public function inBucket(string $name) { - $this->args['Bucket'] = $bucket; + $this->args['Bucket'] = $name; return $this; } @@ -59,7 +59,7 @@ class GetCommand extends ExecutableCommand implements PlainCommand, HasBucket, A * * @return $this */ - public function setFilename(string $filename) + public function byFilename(string $filename) { $this->args['Key'] = $filename; @@ -86,11 +86,13 @@ class GetCommand extends ExecutableCommand implements PlainCommand, HasBucket, A public function ifMatch(string $ifMatch) { $this->args['IfMatch'] = $ifMatch; - + return $this; } /** + * @internal used by the handlers + * * @return string */ public function getName(): string @@ -99,6 +101,8 @@ class GetCommand extends ExecutableCommand implements PlainCommand, HasBucket, A } /** + * @internal used by the handlers + * * @return array */ public function toArgs(): array diff --git a/src/commands/GetPresignedUrlCommand.php b/src/commands/GetPresignedUrlCommand.php index 5c88895..ef88bd9 100644 --- a/src/commands/GetPresignedUrlCommand.php +++ b/src/commands/GetPresignedUrlCommand.php @@ -18,7 +18,7 @@ class GetPresignedUrlCommand extends ExecutableCommand implements HasBucket protected $args = []; /** @var mixed */ - protected $expires; + protected $expiration; /** * @return string @@ -29,13 +29,13 @@ class GetPresignedUrlCommand extends ExecutableCommand implements HasBucket } /** - * @param string $bucket + * @param string $name * * @return $this */ - public function setBucket(string $bucket) + public function inBucket(string $name) { - $this->args['Bucket'] = $bucket; + $this->args['Bucket'] = $name; return $this; } @@ -53,7 +53,7 @@ class GetPresignedUrlCommand extends ExecutableCommand implements HasBucket * * @return $this */ - public function setFilename(string $filename) + public function byFilename(string $filename) { $this->args['Key'] = $filename; @@ -63,24 +63,26 @@ class GetPresignedUrlCommand extends ExecutableCommand implements HasBucket /** * @return mixed */ - public function getExpires() + public function getExpiration() { - return $this->expires; + return $this->expiration; } /** - * @param int|string|\DateTime $expires + * @param int|string|\DateTime $expiration * * @return $this */ - public function setExpires($expires) + public function withExpiration($expiration) { - $this->expires = $expires; + $this->expiration = $expiration; return $this; } /** + * @internal used by the handlers + * * @return array */ public function getArgs(): array diff --git a/src/commands/GetUrlCommand.php b/src/commands/GetUrlCommand.php index 63038df..e6f2c1a 100644 --- a/src/commands/GetUrlCommand.php +++ b/src/commands/GetUrlCommand.php @@ -29,14 +29,14 @@ class GetUrlCommand extends ExecutableCommand implements HasBucket } /** - * @param string $bucket + * @param string $name * * @return $this */ - public function setBucket(string $bucket) + public function inBucket(string $name) { - $this->bucket = $bucket; - + $this->bucket = $name; + return $this; } @@ -53,10 +53,10 @@ class GetUrlCommand extends ExecutableCommand implements HasBucket * * @return $this */ - public function setFilename(string $filename) + public function byFilename(string $filename) { $this->filename = $filename; - + return $this; } } diff --git a/src/commands/PutCommand.php b/src/commands/PutCommand.php index ce93e40..495cc90 100644 --- a/src/commands/PutCommand.php +++ b/src/commands/PutCommand.php @@ -36,13 +36,13 @@ class PutCommand extends ExecutableCommand implements PlainCommand, HasBucket, H } /** - * @param string $bucket + * @param string $name * * @return $this */ - public function setBucket(string $bucket) + public function inBucket(string $name) { - $this->args['Bucket'] = $bucket; + $this->args['Bucket'] = $name; return $this; } @@ -60,7 +60,7 @@ class PutCommand extends ExecutableCommand implements PlainCommand, HasBucket, H * * @return $this */ - public function setFilename(string $filename) + public function withFilename(string $filename) { $this->args['Key'] = $filename; @@ -80,7 +80,7 @@ class PutCommand extends ExecutableCommand implements PlainCommand, HasBucket, H * * @return $this */ - public function setAcl(string $acl) + public function withAcl(string $acl) { $this->args['ACL'] = $acl; @@ -100,7 +100,7 @@ class PutCommand extends ExecutableCommand implements PlainCommand, HasBucket, H * * @return $this */ - public function setBody($body) + public function withBody($body) { $this->args['Body'] = $body; @@ -120,7 +120,7 @@ class PutCommand extends ExecutableCommand implements PlainCommand, HasBucket, H * * @return $this */ - public function setMetadata(array $metadata) + public function withMetadata(array $metadata) { $this->args['Metadata'] = $metadata; @@ -140,7 +140,7 @@ class PutCommand extends ExecutableCommand implements PlainCommand, HasBucket, H * * @return $this */ - public function setContentType(string $contentType) + public function withContentType(string $contentType) { $this->args['ContentType'] = $contentType; @@ -150,7 +150,7 @@ class PutCommand extends ExecutableCommand implements PlainCommand, HasBucket, H /** * @return mixed */ - public function getExpires() + public function getExpiration() { return $this->args['Expires'] ?? null; } @@ -160,7 +160,7 @@ class PutCommand extends ExecutableCommand implements PlainCommand, HasBucket, H * * @return $this */ - public function setExpires($expires) + public function withExpiration($expires) { $this->args['Expires'] = $expires; @@ -168,6 +168,8 @@ class PutCommand extends ExecutableCommand implements PlainCommand, HasBucket, H } /** + * @internal used by the handlers + * * @return string */ public function getName(): string @@ -176,6 +178,8 @@ class PutCommand extends ExecutableCommand implements PlainCommand, HasBucket, H } /** + * @internal used by the handlers + * * @return array */ public function toArgs(): array diff --git a/src/commands/RestoreCommand.php b/src/commands/RestoreCommand.php index ba15c0a..2b0fa7d 100644 --- a/src/commands/RestoreCommand.php +++ b/src/commands/RestoreCommand.php @@ -33,13 +33,13 @@ class RestoreCommand extends ExecutableCommand implements PlainCommand, HasBucke } /** - * @param string $bucket + * @param string $name * * @return $this */ - public function setBucket(string $bucket) + public function inBucket(string $name) { - $this->args['Bucket'] = $bucket; + $this->args['Bucket'] = $name; return $this; } @@ -57,7 +57,7 @@ class RestoreCommand extends ExecutableCommand implements PlainCommand, HasBucke * * @return $this */ - public function setFilename(string $filename) + public function byFilename(string $filename) { $this->args['Key'] = $filename; @@ -67,7 +67,7 @@ class RestoreCommand extends ExecutableCommand implements PlainCommand, HasBucke /** * @return int lifetime of the active copy in days */ - public function getDays(): int + public function getLifetime(): int { return $this->args['Days'] ?? 0; } @@ -77,7 +77,7 @@ class RestoreCommand extends ExecutableCommand implements PlainCommand, HasBucke * * @return $this */ - public function setDays(int $days) + public function withLifetime(int $days) { $this->args['Days'] = $days; @@ -97,7 +97,7 @@ class RestoreCommand extends ExecutableCommand implements PlainCommand, HasBucke * * @return $this */ - public function setVersionId(string $versionId) + public function withVersionId(string $versionId) { $this->args['VersionId'] = $versionId; @@ -105,6 +105,8 @@ class RestoreCommand extends ExecutableCommand implements PlainCommand, HasBucke } /** + * @internal used by the handlers + * * @return string */ public function getName(): string @@ -113,6 +115,8 @@ class RestoreCommand extends ExecutableCommand implements PlainCommand, HasBucke } /** + * @internal used by the handlers + * * @return array */ public function toArgs(): array diff --git a/src/commands/UploadCommand.php b/src/commands/UploadCommand.php index 6442101..765536a 100644 --- a/src/commands/UploadCommand.php +++ b/src/commands/UploadCommand.php @@ -45,13 +45,13 @@ class UploadCommand extends ExecutableCommand implements HasBucket, HasAcl, Asyn } /** - * @param string $bucket + * @param string $name * * @return $this */ - public function setBucket(string $bucket) + public function inBucket(string $name) { - $this->bucket = $bucket; + $this->bucket = $name; return $this; } @@ -69,7 +69,7 @@ class UploadCommand extends ExecutableCommand implements HasBucket, HasAcl, Asyn * * @return $this */ - public function setAcl(string $acl) + public function withAcl(string $acl) { $this->acl = $acl; @@ -89,7 +89,7 @@ class UploadCommand extends ExecutableCommand implements HasBucket, HasAcl, Asyn * * @return $this */ - public function setSource($source) + public function withSource($source) { $this->source = $source; @@ -109,7 +109,7 @@ class UploadCommand extends ExecutableCommand implements HasBucket, HasAcl, Asyn * * @return $this */ - public function setFilename(string $filename) + public function withFilename(string $filename) { $this->filename = $filename; @@ -129,7 +129,7 @@ class UploadCommand extends ExecutableCommand implements HasBucket, HasAcl, Asyn * * @return $this */ - public function setPartSize(int $partSize) + public function withPartSize(int $partSize) { $this->options['part_size'] = $partSize; @@ -149,7 +149,7 @@ class UploadCommand extends ExecutableCommand implements HasBucket, HasAcl, Asyn * * @return $this */ - public function setConcurrency(int $concurrency) + public function withConcurrency(int $concurrency) { $this->options['concurrency'] = $concurrency; @@ -169,7 +169,7 @@ class UploadCommand extends ExecutableCommand implements HasBucket, HasAcl, Asyn * * @return $this */ - public function setMupThreshold(int $mupThreshold) + public function withMupThreshold(int $mupThreshold) { $this->options['mup_threshold'] = $mupThreshold; @@ -189,11 +189,9 @@ class UploadCommand extends ExecutableCommand implements HasBucket, HasAcl, Asyn * * @return $this */ - public function setContentType(string $contentType) + public function withContentType(string $contentType) { - $this->setParam('ContentType', $contentType); - - return $this; + return $this->withParam('ContentType', $contentType); } /** @@ -209,37 +207,35 @@ class UploadCommand extends ExecutableCommand implements HasBucket, HasAcl, Asyn * * @return $this */ - public function setContentDisposition(string $contentDisposition) + public function withContentDisposition(string $contentDisposition) { - $this->setParam('ContentDisposition', $contentDisposition); + return $this->withParam('ContentDisposition', $contentDisposition); + } + + /** + * @param string $name + * @param mixed $default + * + * @return mixed + */ + public function getParam(string $name, $default = null) + { + return $this->options['params'][$name] ?? $default; + } + + /** + * @param string $name + * @param mixed $value + * + * @return $this + */ + public function withParam(string $name, $value) + { + $this->options['params'][$name] = $value; return $this; } - /** - * @return array - */ - public function getParams(): array - { - return $this->options['params'] ?? []; - } - - /** - * @param array $params - */ - public function setParams(array $params) - { - $this->options['params'] = $params; - } - - /** - * @return array - */ - public function getOptions(): array - { - return $this->options; - } - /** * @param callable $beforeUpload * @@ -253,22 +249,12 @@ class UploadCommand extends ExecutableCommand implements HasBucket, HasAcl, Asyn } /** - * @param string $name - * @param mixed $default + * @internal used by the handlers * - * @return mixed + * @return array */ - protected function getParam(string $name, $default) + public function getOptions(): array { - return $this->options['params'][$name] ?? $default; - } - - /** - * @param string $name - * @param mixed $value - */ - protected function setParam(string $name, $value) - { - $this->options['params'][$name] = $value; + return $this->options; } } diff --git a/src/handlers/GetPresignedUrlCommandHandler.php b/src/handlers/GetPresignedUrlCommandHandler.php index c33b582..4af62b8 100644 --- a/src/handlers/GetPresignedUrlCommandHandler.php +++ b/src/handlers/GetPresignedUrlCommandHandler.php @@ -20,7 +20,7 @@ final class GetPresignedUrlCommandHandler extends Handler public function handle(GetPresignedUrlCommand $command): string { $awsCommand = $this->s3Client->getCommand('GetObject', $command->getArgs()); - $request = $this->s3Client->createPresignedRequest($awsCommand, $command->getExpires()); + $request = $this->s3Client->createPresignedRequest($awsCommand, $command->getExpiration()); return (string)$request->getUri(); } diff --git a/src/handlers/PlainCommandHandler.php b/src/handlers/PlainCommandHandler.php index f1a4f06..b139a50 100644 --- a/src/handlers/PlainCommandHandler.php +++ b/src/handlers/PlainCommandHandler.php @@ -21,7 +21,7 @@ final class PlainCommandHandler extends Handler */ public function handle(PlainCommand $command) { - $awsCommand = $this->toAwsCommand($command); + $awsCommand = $this->transformToAwsCommand($command); /** @var \GuzzleHttp\Promise\PromiseInterface $promise */ $promise = $this->s3Client->executeAsync($awsCommand); @@ -44,7 +44,7 @@ final class PlainCommandHandler extends Handler * * @return \Aws\CommandInterface */ - protected function toAwsCommand(PlainCommand $command): AwsCommand + protected function transformToAwsCommand(PlainCommand $command): AwsCommand { $args = array_filter($command->toArgs()); diff --git a/src/handlers/UploadCommandHandler.php b/src/handlers/UploadCommandHandler.php index 1439c43..68cdfe4 100644 --- a/src/handlers/UploadCommandHandler.php +++ b/src/handlers/UploadCommandHandler.php @@ -21,9 +21,9 @@ final class UploadCommandHandler extends Handler */ public function handle(UploadCommand $command) { - $source = $this->toStream($command->getSource()); + $source = $this->sourceToStream($command->getSource()); $options = array_filter($command->getOptions()); - + $promise = $this->s3Client->uploadAsync( $command->getBucket(), $command->getFilename(), @@ -31,7 +31,7 @@ final class UploadCommandHandler extends Handler $command->getAcl(), $options ); - + return $command->isAsync() ? $promise : $promise->wait(); } @@ -42,7 +42,7 @@ final class UploadCommandHandler extends Handler * * @return StreamInterface */ - protected function toStream($source): StreamInterface + protected function sourceToStream($source): StreamInterface { if (is_string($source)) { $source = Psr7\try_fopen($source, 'r+'); diff --git a/src/interfaces/commands/HasAcl.php b/src/interfaces/commands/HasAcl.php index 67cdbbd..9dda9bc 100644 --- a/src/interfaces/commands/HasAcl.php +++ b/src/interfaces/commands/HasAcl.php @@ -12,5 +12,5 @@ interface HasAcl /** * @param string $acl */ - public function setAcl(string $acl); + public function withAcl(string $acl); } diff --git a/src/interfaces/commands/HasBucket.php b/src/interfaces/commands/HasBucket.php index 9432ca6..497f204 100644 --- a/src/interfaces/commands/HasBucket.php +++ b/src/interfaces/commands/HasBucket.php @@ -10,7 +10,7 @@ namespace frostealth\yii2\aws\s3\interfaces\commands; interface HasBucket { /** - * @param string $bucket + * @param string $name */ - public function setBucket(string $bucket); + public function inBucket(string $name); }