Skip to content

Commit

Permalink
Try to satisfy drone.
Browse files Browse the repository at this point in the history
  • Loading branch information
pjdevries committed Jun 2, 2021
1 parent 03c8872 commit 76a935d
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions plugins/filesystem/local/local.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php
/**
* @package Joomla.Plugin
* @subpackage FileSystem.Local
* @package Joomla.Plugin
* @subpackage FileSystem.Local
*
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @license GNU General Public License version 2 or later; see
* LICENSE.txt
*/

defined('_JEXEC') or die;
Expand All @@ -14,6 +15,7 @@
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\Component\Media\Administrator\Event\MediaProviderEvent;
use Joomla\Component\Media\Administrator\Provider\ProviderInterface;
use Joomla\Plugin\Filesystem\Local\Adapter\LocalAdapter;

/**
* FileSystem Local plugin.
Expand All @@ -25,7 +27,8 @@
class PlgFileSystemLocal extends CMSPlugin implements ProviderInterface
{
/**
* Affects constructor behavior. If true, language files will be loaded automatically.
* Affects constructor behavior. If true, language files will be loaded
* automatically.
*
* @var boolean
* @since 4.0.0
Expand Down Expand Up @@ -88,9 +91,7 @@ public function getAdapters()
$directoryPath = JPATH_ROOT . '/' . $directoryEntity->directory;
$directoryPath = rtrim($directoryPath) . '/';

$adapter = new \Joomla\Plugin\Filesystem\Local\Adapter\LocalAdapter(
$directoryPath, $directoryEntity->directory
);
$adapter = new LocalAdapter($directoryPath, $directoryEntity->directory);

$adapters[$adapter->getAdapterName()] = $adapter;
}
Expand All @@ -112,10 +113,12 @@ private function getDirectories()
$directories = (array) $this->params->get('directories');

// Filter out empty entries.
$directories = array_filter($directories, function ($directoryEntity)
{
return !empty($directoryEntity->directory);
});
$directories = array_filter(
$directories,
function ($directoryEntity) {
return !empty($directoryEntity->directory);
}
);

// If directories have been configured, return them.
if (count($directories))
Expand All @@ -124,9 +127,11 @@ private function getDirectories()
}

// Return Media Manager's file path setting.
$comMediaParams = ComponentHelper::getParams('com_media');
$defaultDirectory = new \stdClass();
$defaultDirectory->directory = $comMediaParams->get('file_path', 'images');;
$comMediaParams = ComponentHelper::getParams('com_media');
$defaultDirectory = new \stdClass;
$defaultDirectory->directory = $comMediaParams->get(
'file_path', 'images'
);

return [$defaultDirectory];
}
Expand Down

0 comments on commit 76a935d

Please sign in to comment.