Skip to content

Commit

Permalink
chore: improve adapter creation
Browse files Browse the repository at this point in the history
  • Loading branch information
nerg4l committed Apr 1, 2024
1 parent 001d703 commit d4d6a4f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/MultipartOfMadness.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

class MultipartOfMadness extends AwsS3V3Adapter
{
public function __construct(AwsS3V3Adapter $adapter)
public static function fromAdapter(AwsS3V3Adapter $adapter)
{
parent::__construct(
return new static(
$adapter->getDriver(),
$adapter->getAdapter(),
$adapter->getConfig(),
Expand Down
2 changes: 1 addition & 1 deletion src/MultipartOfMadnessServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function register()
/** @var FilesystemManager $manager */
$manager = $app->make(FilesystemManager::class);
$disk = config('multipart-of-madness.storage_disk', 's3');
return new MultipartOfMadness($manager->disk($disk));
return MultipartOfMadness::fromAdapter($manager->disk($disk));
});

$this->app->singleton('multipart-of-madness', function ($app) {
Expand Down

0 comments on commit d4d6a4f

Please sign in to comment.