Skip to content

Commit

Permalink
Make formatter optional in uploadFormatted(), uploadStreamFormatted()…
Browse files Browse the repository at this point in the history
… and makeFormattedPath() methods
  • Loading branch information
Jeckerson committed Dec 17, 2020
1 parent 8eb02ae commit 50a67e5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Files.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ public function upload(string $filenamePath, string $contents): void
/**
* @param string $filenamePath
* @param string $contents
* @param FormatterInterface $formatter
* @param FormatterInterface|null $formatter
* @throws FilesystemException
*/
public function uploadFormatted(string $filenamePath, string $contents, FormatterInterface $formatter): void
public function uploadFormatted(string $filenamePath, string $contents, ?FormatterInterface $formatter = null): void
{
$this->upload($this->makeFormattedPath($filenamePath, $formatter), $contents);
}
Expand All @@ -92,20 +92,20 @@ public function uploadStream(string $filenamePath, $resource): void
/**
* @param string $filenamePath
* @param $resource
* @param FormatterInterface $formatter
* @param FormatterInterface|null $formatter
* @throws FilesystemException
*/
public function uploadStreamFormatted(string $filenamePath, $resource, FormatterInterface $formatter): void
public function uploadStreamFormatted(string $filenamePath, $resource, ?FormatterInterface $formatter = null): void
{
$this->uploadStream($this->makeFormattedPath($filenamePath, $formatter), $resource);
}

/**
* @param string $filenamePath
* @param FormatterInterface $formatter
* @param FormatterInterface|null $formatter
* @return string
*/
private function makeFormattedPath(string $filenamePath, FormatterInterface $formatter): string
private function makeFormattedPath(string $filenamePath, ?FormatterInterface $formatter = null): string
{
$pathParts = explode(DIRECTORY_SEPARATOR, $filenamePath);
$pathOnly = array_pop($pathParts);
Expand Down

0 comments on commit 50a67e5

Please sign in to comment.