Skip to content

Commit

Permalink
Add 3d param Config in Files::upload() and Files::uploadStream() methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeckerson committed Jan 31, 2021
1 parent 4660057 commit c402b98
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Files.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,13 @@ public function delete(string $filenamePath)
/**
* @param string $filenamePath
* @param string $contents
* @param Config|null $config
* @throws FilesystemException
*/
public function upload(string $filenamePath, string $contents): void
public function upload(string $filenamePath, string $contents, ?Config $config = null): void
{
$this->fileSystemAdapter->write($filenamePath, $contents, new Config());
$config = $config ?: new Config();
$this->fileSystemAdapter->write($filenamePath, $contents, $config);
}

/**
Expand All @@ -91,11 +93,13 @@ public function uploadFormatted(string $filenamePath, string $contents, ?Formatt
/**
* @param string $filenamePath
* @param $resource
* @param Config|null $config
* @throws FilesystemException
*/
public function uploadStream(string $filenamePath, $resource): void
public function uploadStream(string $filenamePath, $resource, ?Config $config = null): void
{
$this->fileSystemAdapter->writeStream($filenamePath, $resource, new Config());
$config = $config ?: new Config();
$this->fileSystemAdapter->writeStream($filenamePath, $resource, $config);
}

/**
Expand Down

0 comments on commit c402b98

Please sign in to comment.