for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types=1);
/**
* This file is part of the daikon-cqrs/flysystem-adapter project.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Daikon\Flysystem\Connector;
use Daikon\Dbal\Connector\ConnectorInterface;
use Daikon\Dbal\Connector\ProvidesConnector;
use League\Flysystem\AdapterInterface;
use League\Flysystem\Filesystem;
use League\Flysystem\MountManager;
final class FlysystemConnector implements ConnectorInterface
{
use ProvidesConnector;
protected function connect(): MountManager
$mounts = [];
foreach ($this->settings['mounts'] as $mountName => $mountConfig) {
$adapterClass = $mountConfig['adapter'];
/** @var AdapterInterface $adapter */
$adapter = new $adapterClass($mountConfig['location']);
$mounts[$mountName] = new Filesystem($adapter);
}
return new MountManager($mounts);
League\Flysystem\MountManager
If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated annotation
ignore-deprecated
return /** @scrutinizer ignore-deprecated */ new MountManager($mounts);