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 67dac33
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 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 @@ -24,8 +25,10 @@
*/
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,7 +91,8 @@ public function getAdapters()
$directoryPath = JPATH_ROOT . '/' . $directoryEntity->directory;
$directoryPath = rtrim($directoryPath) . '/';

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

Expand All @@ -112,10 +116,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,10 +130,13 @@ 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];
}

}

0 comments on commit 67dac33

Please sign in to comment.