diff --git a/src/Bucket.php b/src/Bucket.php index edf1d3d..fb1ffd4 100644 --- a/src/Bucket.php +++ b/src/Bucket.php @@ -177,5 +177,4 @@ protected function formatBucketName(string $name): string { return str(preg_replace('/[^a-zA-Z0-9]/', '', $name))->lower()->toString(); } - } diff --git a/src/Exceptions/BaseException.php b/src/Exceptions/BaseException.php index 0b2c2eb..cfbbff4 100644 --- a/src/Exceptions/BaseException.php +++ b/src/Exceptions/BaseException.php @@ -8,7 +8,6 @@ abstract class BaseException extends Exception { - protected array $data; protected AwsException $awsException; diff --git a/src/Exceptions/CreateBucketException.php b/src/Exceptions/CreateBucketException.php index c951d78..d62b626 100644 --- a/src/Exceptions/CreateBucketException.php +++ b/src/Exceptions/CreateBucketException.php @@ -7,15 +7,13 @@ class CreateBucketException extends BaseException { - public function __construct( protected Tenant $tenant, protected string $bucketName, protected AwsException $awsException - ) - { + ) { $message = "[tenant-buckets] Error: (Tenant ID: {$tenant->id}) {$awsException->getAwsErrorMessage()}"; - parent::__construct($message,$awsException->getCode(), $awsException); + parent::__construct($message, $awsException->getCode(), $awsException); $this->setData(); } @@ -30,7 +28,7 @@ private function setData(): static 'error_message' => $this->awsException->getAwsErrorMessage(), 'response' => $this->awsException->getResponse(), ]; + return $this; } - } diff --git a/src/Exceptions/DeleteBucketException.php b/src/Exceptions/DeleteBucketException.php index b64e5ac..c74f31d 100644 --- a/src/Exceptions/DeleteBucketException.php +++ b/src/Exceptions/DeleteBucketException.php @@ -7,15 +7,13 @@ class DeleteBucketException extends BaseException { - public function __construct( protected Tenant $tenant, protected string $bucketName, protected AwsException $awsException - ) - { + ) { $message = "[tenant-buckets] Error: (Tenant ID: {$tenant->id}) {$awsException->getAwsErrorMessage()}"; - parent::__construct($message,$awsException->getCode(), $awsException); + parent::__construct($message, $awsException->getCode(), $awsException); $this->setData(); } @@ -30,7 +28,7 @@ private function setData(): static 'error_message' => $this->awsException->getAwsErrorMessage(), 'response' => $this->awsException->getResponse(), ]; + return $this; } - }