for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace UniSharp\LaravelFilemanager\Middlewares;
use Closure;
use UniSharp\LaravelFilemanager\Lfm;
use UniSharp\LaravelFilemanager\LfmPath;
class CreateDefaultFolder
{
private $lfm;
private $helper;
public function __construct()
$this->lfm = app(LfmPath::class);
app
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
$this->lfm = /** @scrutinizer ignore-call */ app(LfmPath::class);
$this->helper = app(Lfm::class);
}
public function handle($request, Closure $next)
$this->checkDefaultFolderExists('user');
$this->checkDefaultFolderExists('share');
return $next($request);
private function checkDefaultFolderExists($type = 'share')
if (! $this->helper->allowFolderType($type)) {
return;
$this->lfm->dir($this->helper->getRootFolder($type))->createFolder();