Skip to content

Commit

Permalink
Merge branch '5.0-dev' into document-event
Browse files Browse the repository at this point in the history
 Conflicts:
	libraries/src/Application/ApiApplication.php
  • Loading branch information
Fedik committed Jul 1, 2023
2 parents 1efc69a + 5bfe800 commit 063af45
Show file tree
Hide file tree
Showing 1,757 changed files with 19,324 additions and 9,623 deletions.
9 changes: 8 additions & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ steps:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Unit

- name: php82-unit
depends_on: [ phpcs ]
image: joomlaprojects/docker-images:php8.2
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Unit

- name: php81-integration
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.1
Expand Down Expand Up @@ -365,6 +372,6 @@ trigger:

---
kind: signature
hmac: 7d729d1bdab99cbf37d96324d129a7f3c7eca72a271c70af8755d99c0ae91142
hmac: 6b06b1c7f407650fe98f0851dc865911f399422116fa4f250a52d01a556397ed

...
9 changes: 9 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Short array syntax change https://github.com/joomla/joomla-cms/pull/39616
10f250f418851674c2e4104b6b39b9b665496544

# Code style fixes from PHP CS fixer https://github.com/joomla/joomla-cms/pull/39745
1e7527b60ec42032abe7bfb9c000bacf38f65845

# PSR 12
dd91072a956a19a43798515239892edd2b49ac7b
e7f5cc182bb1cd39c7f085d529888ac4fa6fc77e
4 changes: 4 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@
'binary_operator_spaces' => ['operators' => ['=>' => 'align_single_space_minimal', '=' => 'align']],
// The "No break" comment in switch statements
'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 @@ -17,7 +17,7 @@
// phpcs:enable PSR1.Files.SideEffects

/**
* Plugins master display controller.
* Plugins display controller.
*
* @since 4.0.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
// phpcs:enable PSR1.Files.SideEffects

/**
* ComponentDispatcher class for com_admin
* ComponentDispatcher class for com_actionlogs
*
* @since 4.2.7
*/
class Dispatcher extends ComponentDispatcher
{
/**
* com_admin does not require check permission, so we override checkAccess method and have it empty
* Method to check component access permission
*
* @return void
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// phpcs:enable PSR1.Files.SideEffects

/**
* Field to load a list of all users that have logged actions
* Field to load a list of all extensions that have logged actions
*
* @since 3.9.0
*/
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\Plugin;

use Joomla\CMS\Factory;
use Joomla\CMS\Plugin\CMSPlugin;

// phpcs:disable PSR1.Files.SideEffects
Expand Down Expand Up @@ -64,7 +63,7 @@ abstract class ActionLogPlugin extends CMSPlugin
*/
protected function addLog($messages, $messageLanguageKey, $context, $userId = null)
{
$user = Factory::getUser();
$user = $this->app->getIdentity();

foreach ($messages as $index => $message) {
if (!\array_key_exists('userid', $message)) {
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

0 comments on commit 063af45

Please sign in to comment.