Skip to content

Commit

Permalink
Merge branch '4.4-dev' into plugins/text
Browse files Browse the repository at this point in the history
  • Loading branch information
laoneo committed Jun 28, 2023
2 parents 7a03dab + 713fa82 commit c1ec401
Show file tree
Hide file tree
Showing 215 changed files with 934 additions and 1,197 deletions.
2 changes: 2 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@
'no_break_comment' => ['comment_text' => 'No break'],
// Remove unused imports
'no_unused_imports' => true,
// Classes from the global namespace should not be imported
'global_namespace_import' => ['import_classes' => false, 'import_constants' => false, 'import_functions' => false],
]
)
->setFinder($finder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@

namespace Joomla\Component\Actionlogs\Administrator\Controller;

use DateTimeZone;
use Exception;
use InvalidArgumentException;
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Date\Date;
Expand Down Expand Up @@ -48,7 +45,7 @@ class ActionlogsController extends AdminController
*
* @since 3.9.0
*
* @throws Exception
* @throws \Exception
*/
public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null)
{
Expand All @@ -64,7 +61,7 @@ public function __construct($config = [], MVCFactoryInterface $factory = null, $
*
* @since 3.9.0
*
* @throws Exception
* @throws \Exception
*/
public function exportLogs()
{
Expand All @@ -89,7 +86,7 @@ public function exportLogs()
if (\count($data)) {
try {
$rows = ActionlogsHelper::getCsvData($data);
} catch (InvalidArgumentException $exception) {
} catch (\InvalidArgumentException $exception) {
$this->setMessage(Text::_('COM_ACTIONLOGS_ERROR_COULD_NOT_EXPORT_DATA'), 'error');
$this->setRedirect(Route::_('index.php?option=com_actionlogs&view=actionlogs', false));

Expand All @@ -99,7 +96,7 @@ public function exportLogs()
// Destroy the iterator now
unset($data);

$date = new Date('now', new DateTimeZone('UTC'));
$date = new Date('now', new \DateTimeZone('UTC'));
$filename = 'logs_' . $date->format('Y-m-d_His_T');

$csvDelimiter = ComponentHelper::getComponent('com_actionlogs')->getParams()->get('csv_delimiter', ',');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace Joomla\Component\Actionlogs\Administrator\Helper;

use Generator;
use Joomla\CMS\Date\Date;
use Joomla\CMS\Factory;
use Joomla\CMS\Filesystem\Path;
Expand Down Expand Up @@ -44,13 +43,13 @@ class ActionlogsHelper
*
* @param array|\Traversable $data The logs data objects to be exported
*
* @return Generator
* @return \Generator
*
* @since 3.9.0
*
* @throws \InvalidArgumentException
*/
public static function getCsvData($data): Generator
public static function getCsvData($data): \Generator
{
if (!is_iterable($data)) {
throw new \InvalidArgumentException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
namespace Joomla\Component\Actionlogs\Administrator\Model;

use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use stdClass;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
Expand All @@ -29,11 +28,11 @@ class ActionlogConfigModel extends BaseDatabaseModel
*
* @param string $context The context of the content
*
* @return stdClass|null An object contains content type parameters, or null if not found
* @return \stdClass|null An object contains content type parameters, or null if not found
*
* @since 4.2.0
*/
public function getLogContentTypeParams(string $context): ?stdClass
public function getLogContentTypeParams(string $context): ?\stdClass
{
$db = $this->getDatabase();
$query = $db->getQuery(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

namespace Joomla\Component\Actionlogs\Administrator\Model;

use DateTimeZone;
use Exception;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Date\Date;
use Joomla\CMS\Factory;
Expand All @@ -22,7 +20,6 @@
use Joomla\Database\DatabaseQuery;
use Joomla\Database\ParameterType;
use Joomla\Utilities\ArrayHelper;
use RuntimeException;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
Expand All @@ -42,7 +39,7 @@ class ActionlogsModel extends ListModel
*
* @since 3.9.0
*
* @throws Exception
* @throws \Exception
*/
public function __construct($config = [])
{
Expand Down Expand Up @@ -71,7 +68,7 @@ public function __construct($config = [])
*
* @since 3.9.0
*
* @throws Exception
* @throws \Exception
*/
protected function populateState($ordering = 'a.id', $direction = 'desc')
{
Expand All @@ -85,7 +82,7 @@ protected function populateState($ordering = 'a.id', $direction = 'desc')
*
* @since 3.9.0
*
* @throws Exception
* @throws \Exception
*/
protected function getListQuery()
{
Expand Down Expand Up @@ -174,7 +171,7 @@ protected function getListQuery()
*
* @since 3.9.0
*
* @throws Exception
* @throws \Exception
*/
private function buildDateRange($range)
{
Expand Down Expand Up @@ -212,7 +209,7 @@ private function buildDateRange($range)
$dStart->setTime(0, 0, 0);

// Now change the timezone back to UTC.
$tz = new DateTimeZone('GMT');
$tz = new \DateTimeZone('GMT');
$dStart->setTimezone($tz);
break;
}
Expand Down Expand Up @@ -341,7 +338,7 @@ public function delete(&$pks)

try {
$db->execute();
} catch (RuntimeException $e) {
} catch (\RuntimeException $e) {
$this->setError($e->getMessage());

return false;
Expand All @@ -363,7 +360,7 @@ public function purge()
{
try {
$this->getDatabase()->truncateTable('#__action_logs');
} catch (Exception $e) {
} catch (\Exception $e) {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace Joomla\Component\Actionlogs\Administrator\View\Actionlogs;

use Exception;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Text;
Expand Down Expand Up @@ -98,7 +97,7 @@ class HtmlView extends BaseHtmlView
*
* @since 3.9.0
*
* @throws Exception
* @throws \Exception
*/
public function display($tpl = null)
{
Expand Down
5 changes: 3 additions & 2 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Joomla\CMS\Log\Log;
use Joomla\CMS\Table\Table;
use Joomla\Component\Fields\Administrator\Model\FieldModel;
use Joomla\Database\DatabaseInterface;
use Joomla\Database\ParameterType;

// phpcs:disable PSR1.Files.SideEffects
Expand Down Expand Up @@ -8835,7 +8836,7 @@ protected function moveRemainingTemplateFiles()
*/
protected function fixTemplateMode(): void
{
$db = Factory::getContainer()->get('DatabaseDriver');
$db = Factory::getContainer()->get(DatabaseInterface::class);

array_map(
function ($template) use ($db) {
Expand Down Expand Up @@ -8867,7 +8868,7 @@ function ($template) use ($db) {
*/
protected function addUserAuthProviderColumn(): void
{
$db = Factory::getContainer()->get('DatabaseDriver');
$db = Factory::getContainer()->get(DatabaseInterface::class);

// Check if the column already exists
$fields = $db->getTableColumns('#__users');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace Joomla\Component\Admin\Administrator\View\Help;

use Exception;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Toolbar\ToolbarHelper;
Expand Down Expand Up @@ -68,7 +67,7 @@ class HtmlView extends BaseHtmlView
*
* @since 1.6
*
* @throws Exception
* @throws \Exception
*/
public function display($tpl = null): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace Joomla\Component\Admin\Administrator\View\Sysinfo;

use Exception;
use Joomla\CMS\Access\Exception\NotAllowed;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
Expand Down Expand Up @@ -80,7 +79,7 @@ class HtmlView extends BaseHtmlView
*
* @since 1.6
*
* @throws Exception
* @throws \Exception
*/
public function display($tpl = null): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace Joomla\Component\Admin\Administrator\View\Sysinfo;

use Exception;
use Joomla\CMS\Access\Exception\NotAllowed;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
Expand All @@ -37,7 +36,7 @@ class JsonView extends AbstractView
*
* @since 3.5
*
* @throws Exception
* @throws \Exception
*/
public function display($tpl = null): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace Joomla\Component\Admin\Administrator\View\Sysinfo;

use Exception;
use Joomla\CMS\Access\Exception\NotAllowed;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
Expand All @@ -37,7 +36,7 @@ class TextView extends AbstractView
*
* @since 3.5
*
* @throws Exception
* @throws \Exception
*/
public function display($tpl = null): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace Joomla\Component\Banners\Administrator\View\Banner;

use Exception;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
Expand Down Expand Up @@ -66,7 +65,7 @@ class HtmlView extends BaseHtmlView
*
* @since 1.5
*
* @throws Exception
* @throws \Exception
*/
public function display($tpl = null): void
{
Expand All @@ -92,7 +91,7 @@ public function display($tpl = null): void
* @return void
*
* @since 1.6
* @throws Exception
* @throws \Exception
*/
protected function addToolbar(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace Joomla\Component\Banners\Administrator\View\Banners;

use Exception;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Helper\ContentHelper;
Expand Down Expand Up @@ -100,7 +99,7 @@ class HtmlView extends BaseHtmlView
* @return void
*
* @since 1.6
* @throws Exception
* @throws \Exception
*/
public function display($tpl = null): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace Joomla\Component\Banners\Administrator\View\Client;

use Exception;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
Expand Down Expand Up @@ -75,7 +74,7 @@ class HtmlView extends BaseHtmlView
*
* @since 1.5
*
* @throws Exception
* @throws \Exception
*/
public function display($tpl = null): void
{
Expand Down Expand Up @@ -103,7 +102,7 @@ public function display($tpl = null): void
*
* @since 1.6
*
* @throws Exception
* @throws \Exception
*/
protected function addToolbar(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace Joomla\Component\Banners\Administrator\View\Clients;

use Exception;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Helper\ContentHelper;
use Joomla\CMS\Language\Text;
Expand Down Expand Up @@ -90,7 +89,7 @@ class HtmlView extends BaseHtmlView
*
* @since 1.6
*
* @throws Exception
* @throws \Exception
*/
public function display($tpl = null): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace Joomla\Component\Banners\Administrator\View\Download;

use Exception;
use Joomla\CMS\Form\Form;
use Joomla\CMS\MVC\View\GenericDataException;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
Expand Down Expand Up @@ -44,7 +43,7 @@ class HtmlView extends BaseHtmlView
*
* @since 1.6
*
* @throws Exception
* @throws \Exception
*/
public function display($tpl = null): void
{
Expand Down

0 comments on commit c1ec401

Please sign in to comment.