Skip to content

Commit

Permalink
Clean up constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
robgridley committed May 18, 2023
1 parent 20cca35 commit 0b2b1ad
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/SmbAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,16 @@ class SmbAdapter implements FilesystemAdapter
*/
private PathPrefixer $prefixer;

/**
* The mime type detector instance.
*
* @var MimeTypeDetector
*/
private MimeTypeDetector $mimeTypeDetector;

/**
* Create an SMB adapter instance.
*
* @param IShare $share
* @param string $root
* @param MimeTypeDetector|null $mimeTypeDetector
* @param MimeTypeDetector $mimeTypeDetector
*/
function __construct(private IShare $share, string $root = '', MimeTypeDetector $mimeTypeDetector = null)
function __construct(private IShare $share, string $root = '', private MimeTypeDetector $mimeTypeDetector = new FinfoMimeTypeDetector())
{
$this->prefixer = new PathPrefixer($root);
$this->mimeTypeDetector = $mimeTypeDetector ?: new FinfoMimeTypeDetector();
}

/**
Expand Down

0 comments on commit 0b2b1ad

Please sign in to comment.