diff --git a/.github/workflows/create-translation-pull-request-v5.yml b/.github/workflows/create-translation-pull-request-v5.yml index a7014b3f76bdb..673410d759b40 100644 --- a/.github/workflows/create-translation-pull-request-v5.yml +++ b/.github/workflows/create-translation-pull-request-v5.yml @@ -1,8 +1,8 @@ -name: Create translation pull request +name: Create translation pull request J5 on: push: - branches: [ translation ] + branches: [ translation5 ] workflow_dispatch: @@ -10,6 +10,10 @@ on: # Run daily at 7:32 - cron: '32 7 * * *' +env: + JOOMLA_MAJOR_VERSION: 5 + JOOMLA_MINOR_VERSION: 5.3 + permissions: contents: read @@ -25,6 +29,7 @@ jobs: - uses: actions/checkout@v3 # We need the full depth to create / update the pull request against the main repo with: + ref: translation5 fetch-depth: 0 - uses: actions/setup-node@v3 with: @@ -37,7 +42,7 @@ jobs: git remote add upstream https://github.com/joomla/joomla-cms.git git fetch upstream git checkout --progress --force -B translation5 refs/remotes/origin/translation5 - git merge upstream/5.1-dev + git merge upstream/${{ env.JOOMLA_MINOR_VERSION }}-dev - name: Fetch and extract translations run: | @@ -49,11 +54,9 @@ jobs: # We use a simple copy paste syntax here if needed customization for different directories run: | cd .. - SYNC_VERSION="v5" - SYNC_PATH="installation/language/" echo ${SYNC_PATH} - rsync -i -rptgo --checksum --ignore-times --delete --exclude="*en-GB*" core-translations-main/joomla_${SYNC_VERSION}/translations/core/${SYNC_PATH} joomla-cms/${SYNC_PATH} + rsync -i -rptgo --checksum --ignore-times --delete --exclude="*en-GB*" core-translations-main/joomla_v${{ env.JOOMLA_MAJOR_VERSION }}/translations/core/${SYNC_PATH} joomla-cms/${SYNC_PATH} - name: Update static error pages run: | @@ -73,5 +76,5 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.API_TOKEN_GITHUB }} run: | - gh pr list -R joomla/joomla-cms --state open --author joomla-translation-bot -S "[5.x] Translation Update" | grep -v "No pull" || \ - gh pr create --title "[5.x] Translation Update" --body "Automatically created pull request based on core-translation repository changes" -R joomla/joomla-cms --base 5.1-dev + gh pr list -R joomla/joomla-cms --state open --author joomla-translation-bot -S "[${{ env.JOOMLA_MINOR_VERSION }}] Translation Update" --base ${{ env.JOOMLA_MINOR_VERSION }}-dev | grep -v "No pull" || \ + gh pr create --title "[${{ env.JOOMLA_MINOR_VERSION }}] Translation Update" --body "Automatically created pull request based on core-translation repository changes" -R joomla/joomla-cms --base ${{ env.JOOMLA_MINOR_VERSION }}-dev diff --git a/administrator/components/com_actionlogs/src/Helper/ActionlogsHelper.php b/administrator/components/com_actionlogs/src/Helper/ActionlogsHelper.php index 658788a9486c4..d253348661abe 100644 --- a/administrator/components/com_actionlogs/src/Helper/ActionlogsHelper.php +++ b/administrator/components/com_actionlogs/src/Helper/ActionlogsHelper.php @@ -53,7 +53,7 @@ public static function getCsvData($data): \Generator { if (!is_iterable($data)) { throw new \InvalidArgumentException( - sprintf( + \sprintf( '%s() requires an array or object implementing the Traversable interface, a %s was given.', __METHOD__, \is_object($data) ? \get_class($data) : \gettype($data) diff --git a/administrator/components/com_actionlogs/src/Model/ActionlogModel.php b/administrator/components/com_actionlogs/src/Model/ActionlogModel.php index 932de5be9698a..f11c3bf87c034 100644 --- a/administrator/components/com_actionlogs/src/Model/ActionlogModel.php +++ b/administrator/components/com_actionlogs/src/Model/ActionlogModel.php @@ -52,7 +52,7 @@ class ActionlogModel extends BaseDatabaseModel implements UserFactoryAwareInterf public function addLog($messages, $messageLanguageKey, $context, $userId = 0) { if (!is_numeric($userId)) { - @trigger_error(sprintf('User ID must be an integer in %s.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(\sprintf('User ID must be an integer in %s.', __METHOD__), E_USER_DEPRECATED); } $user = $userId ? $this->getUserFactory()->loadUserById($userId) : $this->getCurrentUser(); diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index d95337516ba3a..035103d764dc9 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -543,7 +543,7 @@ protected function updateManifestCaches() if (!$installer->refreshManifestCache($extension->extension_id)) { $this->collectError( __METHOD__, - new \Exception(sprintf( + new \Exception(\sprintf( 'Error on updating manifest cache: (type, element, folder, client) = (%s, %s, %s, %s)', $extension->type, $extension->element, @@ -2636,7 +2636,7 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false) if (File::delete(JPATH_ROOT . $file)) { $status['files_deleted'][] = $file; } else { - $status['files_errors'][] = sprintf('Error on deleting file or folder %s', $file); + $status['files_errors'][] = \sprintf('Error on deleting file or folder %s', $file); } } } @@ -2650,7 +2650,7 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false) if (Folder::delete(JPATH_ROOT . $folder)) { $status['folders_deleted'][] = $folder; } else { - $status['folders_errors'][] = sprintf('Error on deleting file or folder %s', $folder); + $status['folders_errors'][] = \sprintf('Error on deleting file or folder %s', $folder); } } } diff --git a/administrator/components/com_admin/sql/updates/mysql/5.2.0-2024-08-22.sql b/administrator/components/com_admin/sql/updates/mysql/5.2.0-2024-08-22.sql new file mode 100644 index 0000000000000..0876fa5024ede --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/5.2.0-2024-08-22.sql @@ -0,0 +1,6 @@ +INSERT INTO `#__guidedtours` (`title`, `description`, `extensions`, `url`, `published`, `language`, `note`, `access`, `uid`, `autostart`, `created`, `created_by`, `modified`, `modified_by`) VALUES +('COM_GUIDEDTOURS_TOUR_WHATSNEW_5_2_TITLE', 'COM_GUIDEDTOURS_TOUR_WHATSNEW_5_2_DESCRIPTION', '["com_cpanel"]', 'administrator/index.php', 1, '*', '', 1, 'joomla-whatsnew-5-2', 1, CURRENT_TIMESTAMP(), 0, CURRENT_TIMESTAMP(), 0); +INSERT INTO `#__guidedtour_steps` (`title`, `description`, `position`, `target`, `type`, `interactive_type`, `url`, `published`, `language`, `note`, `params`, `tour_id`, `created`, `created_by`, `modified`, `modified_by`) +SELECT 'COM_GUIDEDTOURS_TOUR_WHATSNEW_5_2_STEP_0_TITLE', 'COM_GUIDEDTOURS_TOUR_WHATSNEW_5_2_STEP_0_DESCRIPTION', 'right', '#sidebarmenu nav > ul:first-of-type > li:last-child', 0, 1, '', 1, '*', '', '{"required":1,"requiredvalue":""}', MAX(`id`), CURRENT_TIMESTAMP(), 0, CURRENT_TIMESTAMP(), 0 + FROM `#__guidedtours` + WHERE `uid` = 'joomla-whatsnew-5-2'; diff --git a/administrator/components/com_admin/sql/updates/postgresql/5.2.0-2024-08-22.sql b/administrator/components/com_admin/sql/updates/postgresql/5.2.0-2024-08-22.sql new file mode 100644 index 0000000000000..a92672ae0efd7 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/5.2.0-2024-08-22.sql @@ -0,0 +1,6 @@ +INSERT INTO "#__guidedtours" ("title", "description", "extensions", "url", "published", "language", "note", "access", "uid", "autostart", "created", "created_by", "modified", "modified_by") VALUES +('COM_GUIDEDTOURS_TOUR_WHATSNEW_5_2_TITLE', 'COM_GUIDEDTOURS_TOUR_WHATSNEW_5_2_DESCRIPTION', '["com_cpanel"]', 'administrator/index.php', 1, '*', '', 1, 'joomla-whatsnew-5-2', 1, CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0); +INSERT INTO "#__guidedtour_steps" ("title", "description", "position", "target", "type", "interactive_type", "url", "published", "language", "note", "params", "tour_id", "created", "created_by", "modified", "modified_by") +SELECT 'COM_GUIDEDTOURS_TOUR_WHATSNEW_5_2_STEP_0_TITLE', 'COM_GUIDEDTOURS_TOUR_WHATSNEW_5_2_STEP_0_DESCRIPTION', 'right', '#sidebarmenu nav > ul:first-of-type > li:last-child', 0, 1, '', 1, '*', '', '{"required":1,"requiredvalue":""}', MAX("id"), CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0 + FROM "#__guidedtours" + WHERE "uid" = 'joomla-whatsnew-5-2'; diff --git a/administrator/components/com_associations/tmpl/associations/default.php b/administrator/components/com_associations/tmpl/associations/default.php index 01a8f1ad29579..3c6bcc2f202c7 100644 --- a/administrator/components/com_associations/tmpl/associations/default.php +++ b/administrator/components/com_associations/tmpl/associations/default.php @@ -30,9 +30,9 @@ $iconStates = [ -2 => 'icon-trash', - 0 => 'icon-times', - 1 => 'icon-check', - 2 => 'icon-folder', + 0 => 'icon-unpublish', + 1 => 'icon-publish', + 2 => 'icon-archive', ]; Text::script('COM_ASSOCIATIONS_PURGE_CONFIRM_PROMPT', true); diff --git a/administrator/components/com_associations/tmpl/associations/modal.php b/administrator/components/com_associations/tmpl/associations/modal.php index 8db50389fc743..5a4b2214e4519 100644 --- a/administrator/components/com_associations/tmpl/associations/modal.php +++ b/administrator/components/com_associations/tmpl/associations/modal.php @@ -38,9 +38,9 @@ $iconStates = [ -2 => 'icon-trash', - 0 => 'icon-times', - 1 => 'icon-check', - 2 => 'icon-folder', + 0 => 'icon-unpublish', + 1 => 'icon-publish', + 2 => 'icon-archive', ]; $this->getDocument()->addScriptOptions('associations-modal', ['func' => $function]); diff --git a/administrator/components/com_banners/src/Table/BannerTable.php b/administrator/components/com_banners/src/Table/BannerTable.php index 29388eecf588d..bd3968945314b 100644 --- a/administrator/components/com_banners/src/Table/BannerTable.php +++ b/administrator/components/com_banners/src/Table/BannerTable.php @@ -143,7 +143,7 @@ public function check() $this->ordering = 0; } elseif (empty($this->ordering)) { // Set ordering to last if ordering was 0 - $this->ordering = self::getNextOrder($this->_db->quoteName('catid') . ' = ' . ((int) $this->catid) . ' AND ' . $this->_db->quoteName('state') . ' >= 0'); + $this->ordering = $this->getNextOrder($this->_db->quoteName('catid') . ' = ' . ((int) $this->catid) . ' AND ' . $this->_db->quoteName('state') . ' >= 0'); } // Set modified to created if not set diff --git a/administrator/components/com_categories/src/Field/CategoryeditField.php b/administrator/components/com_categories/src/Field/CategoryeditField.php index b443379088c5f..c824639799c3b 100644 --- a/administrator/components/com_categories/src/Field/CategoryeditField.php +++ b/administrator/components/com_categories/src/Field/CategoryeditField.php @@ -242,23 +242,23 @@ protected function getOptions() } // Pad the option text with spaces using depth level as a multiplier. - for ($i = 0, $n = \count($options); $i < $n; $i++) { + foreach ($options as $option) { // Translate ROOT if ($this->element['parent'] == true || $jinput->get('option') == 'com_categories') { - if ($options[$i]->level == 0) { - $options[$i]->text = Text::_('JGLOBAL_ROOT_PARENT'); + if ($option->level == 0) { + $option->text = Text::_('JGLOBAL_ROOT_PARENT'); } } - if ($options[$i]->published == 1) { - $options[$i]->text = str_repeat('- ', !$options[$i]->level ? 0 : $options[$i]->level - 1) . $options[$i]->text; + if ($option->published == 1) { + $option->text = str_repeat('- ', !$option->level ? 0 : $option->level - 1) . $option->text; } else { - $options[$i]->text = str_repeat('- ', !$options[$i]->level ? 0 : $options[$i]->level - 1) . '[' . $options[$i]->text . ']'; + $option->text = str_repeat('- ', !$option->level ? 0 : $option->level - 1) . '[' . $option->text . ']'; } // Displays language code if not set to All - if ($options[$i]->language !== '*') { - $options[$i]->text .= ' (' . $options[$i]->language . ')'; + if ($option->language !== '*') { + $option->text .= ' (' . $option->language . ')'; } } diff --git a/administrator/components/com_categories/tmpl/categories/modal.php b/administrator/components/com_categories/tmpl/categories/modal.php index cc0b2800ceaca..ae7d0fee6e36e 100644 --- a/administrator/components/com_categories/tmpl/categories/modal.php +++ b/administrator/components/com_categories/tmpl/categories/modal.php @@ -79,9 +79,9 @@ 'icon-trash', - 0 => 'icon-times', - 1 => 'icon-check', - 2 => 'icon-folder', + 0 => 'icon-unpublish', + 1 => 'icon-publish', + 2 => 'icon-archive', ]; ?> items as $i => $item) : ?> diff --git a/administrator/components/com_contact/tmpl/contacts/modal.php b/administrator/components/com_contact/tmpl/contacts/modal.php index 8d9fe4391c436..ed2579532dc83 100644 --- a/administrator/components/com_contact/tmpl/contacts/modal.php +++ b/administrator/components/com_contact/tmpl/contacts/modal.php @@ -92,9 +92,9 @@ 'icon-trash', - 0 => 'icon-times', - 1 => 'icon-check', - 2 => 'icon-folder', + 0 => 'icon-unpublish', + 1 => 'icon-publish', + 2 => 'icon-archive', ]; ?> items as $i => $item) : ?> diff --git a/administrator/components/com_content/tmpl/articles/modal.php b/administrator/components/com_content/tmpl/articles/modal.php index 42dd83cc093a7..00619b47145bb 100644 --- a/administrator/components/com_content/tmpl/articles/modal.php +++ b/administrator/components/com_content/tmpl/articles/modal.php @@ -94,8 +94,8 @@ 'icon-trash', - 0 => 'icon-times', - 1 => 'icon-check', + 0 => 'icon-unpublish', + 1 => 'icon-publish', 2 => 'icon-archive', ]; ?> diff --git a/administrator/components/com_content/tmpl/featured/default.php b/administrator/components/com_content/tmpl/featured/default.php index 048b8640421c0..df58b6aa66b58 100644 --- a/administrator/components/com_content/tmpl/featured/default.php +++ b/administrator/components/com_content/tmpl/featured/default.php @@ -203,7 +203,7 @@ 'title' => Text::_($item->stage_title), 'tip_content' => Text::sprintf('JWORKFLOW', Text::_($item->workflow_title)), 'id' => 'workflow-' . $item->id, - 'task' => 'articles.runTransitions' + 'task' => 'articles.runTransition' ]; echo (new TransitionButton($options)) diff --git a/administrator/components/com_fields/forms/field.xml b/administrator/components/com_fields/forms/field.xml index 53fc2fb858a5a..d10862621214e 100644 --- a/administrator/components/com_fields/forms/field.xml +++ b/administrator/components/com_fields/forms/field.xml @@ -1,5 +1,8 @@
+ + +
setDatabase($this->getDatabase()); } catch (DatabaseNotFoundException $e) { - @trigger_error(sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED); + @trigger_error(\sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED); $rule->setDatabase(Factory::getContainer()->get(DatabaseInterface::class)); } } diff --git a/administrator/components/com_fields/src/View/Field/HtmlView.php b/administrator/components/com_fields/src/View/Field/HtmlView.php index 156eda4d7c3f6..4b0ad16686414 100644 --- a/administrator/components/com_fields/src/View/Field/HtmlView.php +++ b/administrator/components/com_fields/src/View/Field/HtmlView.php @@ -161,6 +161,7 @@ function (Toolbar $childBar) use ($checkedOut, $itemEditable, $canDo) { $toolbar->cancel('field.cancel'); } + $toolbar->inlinehelp(); $toolbar->help('Fields:_Edit'); } } diff --git a/administrator/components/com_fields/tmpl/fields/modal.php b/administrator/components/com_fields/tmpl/fields/modal.php index 2319856c991bc..717d6f07b9fd3 100644 --- a/administrator/components/com_fields/tmpl/fields/modal.php +++ b/administrator/components/com_fields/tmpl/fields/modal.php @@ -77,9 +77,9 @@ 'icon-trash', - 0 => 'icon-times', - 1 => 'icon-check', - 2 => 'icon-folder', + 0 => 'icon-unpublish', + 1 => 'icon-publish', + 2 => 'icon-archive', ]; foreach ($this->items as $i => $item) : $attrs = 'data-content-select data-content-type="com_fields.field"' diff --git a/administrator/components/com_finder/src/Indexer/Adapter.php b/administrator/components/com_finder/src/Indexer/Adapter.php index f398751b16d3d..d554f0c5b6799 100644 --- a/administrator/components/com_finder/src/Indexer/Adapter.php +++ b/administrator/components/com_finder/src/Indexer/Adapter.php @@ -256,9 +256,9 @@ public function onBuildIndex() $items = $this->getItems($offset, $limit); // Iterate through the items and index them. - for ($i = 0, $n = \count($items); $i < $n; $i++) { + foreach ($items as $item) { // Index the item. - $this->index($items[$i]); + $this->index($item); // Adjust the offsets. $offset++; diff --git a/administrator/components/com_finder/src/Indexer/DebugAdapter.php b/administrator/components/com_finder/src/Indexer/DebugAdapter.php index b389c897aa040..11f5ea49d0f7d 100644 --- a/administrator/components/com_finder/src/Indexer/DebugAdapter.php +++ b/administrator/components/com_finder/src/Indexer/DebugAdapter.php @@ -254,9 +254,9 @@ public function onBuildIndex() $items = $this->getItems($offset, $limit); // Iterate through the items and index them. - for ($i = 0, $n = \count($items); $i < $n; $i++) { + foreach ($items as $item) { // Index the item. - $this->index($items[$i]); + $this->index($item); // Adjust the offsets. $offset++; diff --git a/administrator/components/com_finder/src/Indexer/Helper.php b/administrator/components/com_finder/src/Indexer/Helper.php index 70ce04dfd9efe..b57cdbdb83de8 100644 --- a/administrator/components/com_finder/src/Indexer/Helper.php +++ b/administrator/components/com_finder/src/Indexer/Helper.php @@ -250,7 +250,7 @@ public static function addContentType($title, $mime = null) $query->clear() ->insert($db->quoteName('#__finder_types')) ->columns([$db->quoteName('title'), $db->quoteName('mime')]) - ->values($db->quote($title) . ', ' . $db->quote($mime)); + ->values($db->quote($title) . ', ' . $db->quote($mime ?? '')); $db->setQuery($query); $db->execute(); diff --git a/administrator/components/com_finder/src/Indexer/Indexer.php b/administrator/components/com_finder/src/Indexer/Indexer.php index fb97cd0af9dcd..b0791b3d1795d 100644 --- a/administrator/components/com_finder/src/Indexer/Indexer.php +++ b/administrator/components/com_finder/src/Indexer/Indexer.php @@ -122,7 +122,7 @@ class Indexer public function __construct(?DatabaseInterface $db = null) { if ($db === null) { - @trigger_error(sprintf('Database will be mandatory in 5.0.'), E_USER_DEPRECATED); + @trigger_error(\sprintf('Database will be mandatory in 5.0.'), E_USER_DEPRECATED); $db = Factory::getContainer()->get(DatabaseInterface::class); } @@ -506,7 +506,7 @@ public function index($item, $format = 'html') // Iterate through the contexts and aggregate the tokens per context. foreach ($state->weights as $context => $multiplier) { // Run the query to aggregate the tokens for this context.. - $db->setQuery(sprintf($query, $multiplier, $context, $context)); + $db->setQuery(\sprintf($query, $multiplier, $context, $context)); $db->execute(); } diff --git a/administrator/components/com_finder/src/Indexer/Query.php b/administrator/components/com_finder/src/Indexer/Query.php index 4f5f8f19b5aaa..61b1bd4cd9b5f 100644 --- a/administrator/components/com_finder/src/Indexer/Query.php +++ b/administrator/components/com_finder/src/Indexer/Query.php @@ -208,7 +208,7 @@ class Query public function __construct($options, ?DatabaseInterface $db = null) { if ($db === null) { - @trigger_error(sprintf('Database will be mandatory in 5.0.'), E_USER_DEPRECATED); + @trigger_error(\sprintf('Database will be mandatory in 5.0.'), E_USER_DEPRECATED); $db = Factory::getContainer()->get(DatabaseInterface::class); } @@ -392,8 +392,8 @@ public function getExcludedTermIds() $results = []; // Iterate through the excluded tokens and compile the matching terms. - for ($i = 0, $c = \count($this->excluded); $i < $c; $i++) { - foreach ($this->excluded[$i]->matches as $match) { + foreach ($this->excluded as $item) { + foreach ($item->matches as $match) { $results = array_merge($results, $match); } } @@ -416,14 +416,14 @@ public function getIncludedTermIds() $results = []; // Iterate through the included tokens and compile the matching terms. - for ($i = 0, $c = \count($this->included); $i < $c; $i++) { + foreach ($this->included as $item) { // Check if we have any terms. - if (empty($this->included[$i]->matches)) { + if (empty($item->matches)) { continue; } // Get the term. - $term = $this->included[$i]->term; + $term = $item->term; // Prepare the container for the term if necessary. if (!\array_key_exists($term, $results)) { @@ -431,7 +431,7 @@ public function getIncludedTermIds() } // Add the matches to the stack. - foreach ($this->included[$i]->matches as $match) { + foreach ($item->matches as $match) { $results[$term] = array_merge($results[$term], $match); } } @@ -457,11 +457,11 @@ public function getRequiredTermIds() $results = []; // Iterate through the included tokens and compile the matching terms. - for ($i = 0, $c = \count($this->included); $i < $c; $i++) { + foreach ($this->included as $item) { // Check if the token is required. - if ($this->included[$i]->required) { + if ($item->required) { // Get the term. - $term = $this->included[$i]->term; + $term = $item->term; // Prepare the container for the term if necessary. if (!\array_key_exists($term, $results)) { @@ -469,7 +469,7 @@ public function getRequiredTermIds() } // Add the matches to the stack. - foreach ($this->included[$i]->matches as $match) { + foreach ($item->matches as $match) { $results[$term] = array_merge($results[$term], $match); } } @@ -1282,12 +1282,12 @@ protected function getTokenData($token) // Check the matching terms. if ((bool) $matches) { // Add the matches to the token. - for ($i = 0, $c = \count($matches); $i < $c; $i++) { - if (!isset($token->matches[$matches[$i]->term])) { - $token->matches[$matches[$i]->term] = []; + foreach ($matches as $item) { + if (!isset($token->matches[$item->term])) { + $token->matches[$item->term] = []; } - $token->matches[$matches[$i]->term][] = (int) $matches[$i]->term_id; + $token->matches[$item->term][] = (int) $item->term_id; } } diff --git a/administrator/components/com_finder/src/Indexer/Result.php b/administrator/components/com_finder/src/Indexer/Result.php index a9964b8849f95..6b8911227c968 100644 --- a/administrator/components/com_finder/src/Indexer/Result.php +++ b/administrator/components/com_finder/src/Indexer/Result.php @@ -392,7 +392,7 @@ public function getTaxonomy($branch = null) * * @since 2.5 */ - public function addTaxonomy($branch, $title, $state = 1, $access = 1, $language = '') + public function addTaxonomy($branch, $title, $state = 1, $access = 1, $language = '*') { // We can't add taxonomies with empty titles if (!trim($title)) { @@ -427,7 +427,7 @@ public function addTaxonomy($branch, $title, $state = 1, $access = 1, $language * * @since 4.0.0 */ - public function addNestedTaxonomy($branch, ImmutableNodeInterface $contentNode, $state = 1, $access = 1, $language = '') + public function addNestedTaxonomy($branch, ImmutableNodeInterface $contentNode, $state = 1, $access = 1, $language = '*') { // We can't add taxonomies with empty titles if (!trim($contentNode->title)) { diff --git a/administrator/components/com_finder/src/Indexer/Taxonomy.php b/administrator/components/com_finder/src/Indexer/Taxonomy.php index 4b673a8ab8e79..ca97737e08f6f 100644 --- a/administrator/components/com_finder/src/Indexer/Taxonomy.php +++ b/administrator/components/com_finder/src/Indexer/Taxonomy.php @@ -67,7 +67,7 @@ public static function addBranch($title, $state = 1, $access = 1) $node->title = $title; $node->access = $access; $node->parent_id = 1; - $node->language = ''; + $node->language = '*'; return self::storeNode($node, 1); } @@ -86,7 +86,7 @@ public static function addBranch($title, $state = 1, $access = 1) * @since 2.5 * @throws \RuntimeException on database error. */ - public static function addNode($branch, $title, $state = 1, $access = 1, $language = '') + public static function addNode($branch, $title, $state = 1, $access = 1, $language = '*') { if ($state != 1) { return 0; @@ -118,7 +118,7 @@ public static function addNode($branch, $title, $state = 1, $access = 1, $langua * * @since 4.0.0 */ - public static function addNestedNode($branch, NodeInterface $node, $state = 1, $access = 1, $language = '', $branchId = null) + public static function addNestedNode($branch, NodeInterface $node, $state = 1, $access = 1, $language = '*', $branchId = null) { if ($state != 1) { return 0; diff --git a/administrator/components/com_guidedtours/config.xml b/administrator/components/com_guidedtours/config.xml index 2ff0681eaa56b..d92e2ea67d562 100644 --- a/administrator/components/com_guidedtours/config.xml +++ b/administrator/components/com_guidedtours/config.xml @@ -1,5 +1,7 @@ + +
getState($this->getName() . '.id'); $table = $this->getTable(); - if (\is_integer($pk)) { + + if (\is_int($pk)) { $result = $table->load((int) $pk); } else { // Attempt to load the row by uid. @@ -576,7 +577,7 @@ public function isAutostart($pk): bool * * @return boolean * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ public function saveTourUserState($id, $state = ''): bool { diff --git a/administrator/components/com_joomlaupdate/extract.php b/administrator/components/com_joomlaupdate/extract.php index b6e0f74a3c6ff..57dd84ef4d8c8 100644 --- a/administrator/components/com_joomlaupdate/extract.php +++ b/administrator/components/com_joomlaupdate/extract.php @@ -630,7 +630,7 @@ public function setIgnoreDirectories(array $ignoreDirectories): void */ public function initialize(): void { - $this->debugMsg(sprintf('Initializing extraction. Filepath: %s', $this->filename)); + $this->debugMsg(\sprintf('Initializing extraction. Filepath: %s', $this->filename)); $this->totalSize = @filesize($this->filename) ?: 0; $this->archiveFileIsBeingRead = false; $this->currentOffset = 0; @@ -639,7 +639,7 @@ public function initialize(): void $this->readArchiveHeader(); if (!empty($this->getError())) { - $this->debugMsg(sprintf('Error: %s', $this->getError()), self::LOG_ERROR); + $this->debugMsg(\sprintf('Error: %s', $this->getError()), self::LOG_ERROR); return; } @@ -688,7 +688,7 @@ public function step(): bool case self::AK_STATE_HEADER: case self::AK_STATE_DATA: $runStateHuman = $this->runState === self::AK_STATE_HEADER ? 'HEADER' : 'DATA'; - $this->debugMsg(sprintf('Current run state: %s', $runStateHuman), self::LOG_DEBUG); + $this->debugMsg(\sprintf('Current run state: %s', $runStateHuman), self::LOG_DEBUG); $status = $this->processFileData(); break; @@ -696,7 +696,7 @@ public function step(): bool case self::AK_STATE_DATAREAD: case self::AK_STATE_POSTPROC: $runStateHuman = $this->runState === self::AK_STATE_DATAREAD ? 'DATAREAD' : 'POSTPROC'; - $this->debugMsg(sprintf('Current run state: %s', $runStateHuman), self::LOG_DEBUG); + $this->debugMsg(\sprintf('Current run state: %s', $runStateHuman), self::LOG_DEBUG); $this->setLastExtractedFileTimestamp($this->fileHeader->timestamp); $this->processLastExtractedFile(); @@ -728,7 +728,7 @@ public function step(): bool $error = $this->getError(); if (!empty($error)) { - $this->debugMsg(sprintf('Step failed with error: %s', $error), self::LOG_ERROR); + $this->debugMsg(\sprintf('Step failed with error: %s', $error), self::LOG_ERROR); } // Did we just finish or run into an error? @@ -790,7 +790,7 @@ private function getRunningTime(): float */ private function processLastExtractedFile(): void { - $this->debugMsg(sprintf('Processing last extracted entity: %s', $this->lastExtractedFilename), self::LOG_DEBUG); + $this->debugMsg(\sprintf('Processing last extracted entity: %s', $this->lastExtractedFilename), self::LOG_DEBUG); if (@is_file($this->lastExtractedFilename)) { @chmod($this->lastExtractedFilename, 0644); @@ -1076,7 +1076,7 @@ private function readFileHeader(): bool default: $messageTemplate = 'This script cannot handle ZIP compression method %d. ' . 'Only 0 (no compression) and 8 (DEFLATE, gzip) can be handled.'; - $actualMessage = sprintf($messageTemplate, $headerData['compmethod']); + $actualMessage = \sprintf($messageTemplate, $headerData['compmethod']); $this->setError($actualMessage); return false; @@ -1094,7 +1094,7 @@ private function readFileHeader(): bool // If we have a banned file, let's skip it if ($isBannedFile) { - $debugMessage = sprintf('Current entity (%s) is banned from extraction and will be skipped over.', $this->fileHeader->file); + $debugMessage = \sprintf('Current entity (%s) is banned from extraction and will be skipped over.', $this->fileHeader->file); $this->debugMsg($debugMessage, self::LOG_DEBUG); // Advance the file pointer, skipping exactly the size of the compressed data @@ -1178,7 +1178,7 @@ private function createDirectory(): void } if ((@mkdir($dirName, $perms, true) === false) && (!$ignore)) { - $this->setError(sprintf('Could not create %s folder', $dirName)); + $this->setError(\sprintf('Could not create %s folder', $dirName)); } } @@ -1216,14 +1216,14 @@ private function processFileData(): bool return $this->processTypeFileCompressed(); case 'default': - $this->setError(sprintf('Unknown compression type %s.', $this->fileHeader->compression)); + $this->setError(\sprintf('Unknown compression type %s.', $this->fileHeader->compression)); return false; } break; } - $this->setError(sprintf('Unknown entry type %s.', $this->fileHeader->type)); + $this->setError(\sprintf('Unknown entry type %s.', $this->fileHeader->type)); return false; } @@ -1296,7 +1296,7 @@ private function setCorrectPermissions(string $path): void $directory = rtrim(\dirname($path), '/\\'); // Is this an unwritable directory? - if (($directory != $rootDir) && !is_writeable($directory)) { + if (($directory != $rootDir) && !is_writable($directory)) { @chmod($directory, 0755); } @@ -1414,7 +1414,7 @@ private function processTypeFileUncompressed(): bool // Can we write to the file? if (($outfp === false) && (!$ignore)) { // An error occurred - $this->setError(sprintf('Could not open %s for writing.', $this->fileHeader->realFile)); + $this->setError(\sprintf('Could not open %s for writing.', $this->fileHeader->realFile)); return false; } @@ -1470,7 +1470,7 @@ private function processTypeFileUncompressed(): bool // Was this a pre-timeout bail out? if ($leftBytes > 0) { - $this->debugMsg(sprintf('We have %d bytes left to extract in the next step', $leftBytes), self::LOG_DEBUG); + $this->debugMsg(\sprintf('We have %d bytes left to extract in the next step', $leftBytes), self::LOG_DEBUG); $this->runState = self::AK_STATE_DATA; return true; @@ -1505,7 +1505,7 @@ private function processTypeFileCompressed(): bool if (($outfp === false) && (!$ignore)) { // An error occurred - $this->setError(sprintf('Could not open %s for writing.', $this->fileHeader->realFile)); + $this->setError(\sprintf('Could not open %s for writing.', $this->fileHeader->realFile)); return false; } @@ -1550,7 +1550,7 @@ private function processTypeFileCompressed(): bool break; default: - $this->setError(sprintf('Unknown compression method %s', $this->fileHeader->compression)); + $this->setError(\sprintf('Unknown compression method %s', $this->fileHeader->compression)); return false; } @@ -1656,7 +1656,7 @@ private function debugMsg(string $message, int $priority = self::LOG_INFO): void break; } - fputs(self::$logFP, sprintf('%s | %7s | %s' . "\r\n", gmdate('Y-m-d H:i:s'), $priorityString, $message)); + fwrite(self::$logFP, \sprintf('%s | %7s | %s' . "\r\n", gmdate('Y-m-d H:i:s'), $priorityString, $message)); } /** diff --git a/administrator/components/com_joomlaupdate/finalisation.php b/administrator/components/com_joomlaupdate/finalisation.php index ca25ce5064393..06f733de5339e 100644 --- a/administrator/components/com_joomlaupdate/finalisation.php +++ b/administrator/components/com_joomlaupdate/finalisation.php @@ -12,8 +12,8 @@ * - Also unlike other files, the normal constant defined checks must be within the global namespace declaration and can't be outside of it */ -namespace -{ +namespace { + // Require the restoration environment or fail cold. Prevents direct web access. \defined('_JOOMLA_UPDATE') or die(); diff --git a/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php b/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php index c686fc5d34263..430b28db8f451 100644 --- a/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php +++ b/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php @@ -1320,10 +1320,9 @@ public function getIniParserAvailability() if (!empty($disabledFunctions)) { // Attempt to detect them in the PHP INI disable_functions variable. $disabledFunctions = explode(',', trim($disabledFunctions)); - $numberOfDisabledFunctions = \count($disabledFunctions); - for ($i = 0; $i < $numberOfDisabledFunctions; $i++) { - $disabledFunctions[$i] = trim($disabledFunctions[$i]); + foreach ($disabledFunctions as &$disabledFunction) { + $disabledFunction = trim($disabledFunction); } $result = !\in_array('parse_ini_string', $disabledFunctions); @@ -1795,7 +1794,7 @@ public function collectError(string $context, \Throwable $error) // Log it Log::add( - sprintf( + \sprintf( 'An error has occurred while running "%s". Code: %s. Message: %s.', $context, $error->getCode(), @@ -1807,7 +1806,7 @@ public function collectError(string $context, \Throwable $error) if (JDEBUG) { $trace = $error->getFile() . ':' . $error->getLine() . PHP_EOL . $error->getTraceAsString(); - Log::add(sprintf('An error trace: %s.', $trace), Log::DEBUG, 'Update'); + Log::add(\sprintf('An error trace: %s.', $trace), Log::DEBUG, 'Update'); } } @@ -2081,7 +2080,7 @@ public function resetUpdateSource() $db->execute(); } catch (\Exception $e) { Log::add( - sprintf( + \sprintf( 'An error has occurred while running "resetUpdateSource". Code: %s. Message: %s.', $e->getCode(), $e->getMessage() diff --git a/administrator/components/com_login/src/Model/LoginModel.php b/administrator/components/com_login/src/Model/LoginModel.php index af855dbce62ea..5c664a1104cdb 100644 --- a/administrator/components/com_login/src/Model/LoginModel.php +++ b/administrator/components/com_login/src/Model/LoginModel.php @@ -80,12 +80,11 @@ public static function getLoginModule($name = 'mod_login', $title = null) { $result = null; $modules = self::_load($name); - $total = \count($modules); - for ($i = 0; $i < $total; $i++) { + foreach ($modules as $module) { // Match the title if we're looking for a specific instance of the module. - if (!$title || $modules[$i]->title == $title) { - $result = $modules[$i]; + if (!$title || $module->title == $title) { + $result = $module; break; } } diff --git a/administrator/components/com_media/src/Controller/ApiController.php b/administrator/components/com_media/src/Controller/ApiController.php index 530f97a0db6cb..427d637115ab0 100644 --- a/administrator/components/com_media/src/Controller/ApiController.php +++ b/administrator/components/com_media/src/Controller/ApiController.php @@ -11,7 +11,6 @@ namespace Joomla\Component\Media\Administrator\Controller; use Joomla\CMS\Component\ComponentHelper; -use Joomla\CMS\Helper\MediaHelper; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\BaseController; @@ -199,7 +198,7 @@ public function postFiles() $override = $content->get('override', false); if ($mediaContent) { - $this->checkContent(); + $this->checkFileSize(\strlen($mediaContent)); // A file needs to be created $name = $this->getModel()->createFile($adapter, $name, $path, $mediaContent, $override); @@ -334,29 +333,21 @@ public function getModel($name = 'Api', $prefix = 'Administrator', $config = []) } /** - * Performs various checks if it is allowed to save the content. + * Performs file size checks if it is allowed to be saved. + * + * @param integer $fileSize The size of submitted file * * @return void * - * @since 4.0.0 + * @since 4.4.9 * @throws \Exception */ - private function checkContent() + private function checkFileSize(int $fileSize) { - $helper = new MediaHelper(); - $contentLength = $this->input->server->getInt('CONTENT_LENGTH'); $params = ComponentHelper::getParams('com_media'); $paramsUploadMaxsize = $params->get('upload_maxsize', 0) * 1024 * 1024; - $uploadMaxFilesize = $helper->toBytes(\ini_get('upload_max_filesize')); - $postMaxSize = $helper->toBytes(\ini_get('post_max_size')); - $memoryLimit = $helper->toBytes(\ini_get('memory_limit')); - - if ( - ($paramsUploadMaxsize > 0 && $contentLength > $paramsUploadMaxsize) - || ($uploadMaxFilesize > 0 && $contentLength > $uploadMaxFilesize) - || ($postMaxSize > 0 && $contentLength > $postMaxSize) - || ($memoryLimit > -1 && $contentLength > $memoryLimit) - ) { + + if ($paramsUploadMaxsize > 0 && $fileSize > $paramsUploadMaxsize) { $link = 'index.php?option=com_config&view=component&component=com_media'; $output = HTMLHelper::_('link', Route::_($link), Text::_('JOPTIONS')); throw new \Exception(Text::sprintf('COM_MEDIA_ERROR_WARNFILETOOLARGE', $output), 403); diff --git a/administrator/components/com_media/src/Event/AbstractMediaItemValidationEvent.php b/administrator/components/com_media/src/Event/AbstractMediaItemValidationEvent.php index c32352b7fe23a..e3990ff47d2c2 100644 --- a/administrator/components/com_media/src/Event/AbstractMediaItemValidationEvent.php +++ b/administrator/components/com_media/src/Event/AbstractMediaItemValidationEvent.php @@ -75,7 +75,7 @@ protected function validate(\stdClass $item): void // An empty string or an integer if ( !isset($item->size) || - (!\is_integer($item->size) && !\is_string($item->size)) || + (!\is_int($item->size) && !\is_string($item->size)) || (\is_string($item->size) && $item->size !== '') ) { throw new \BadMethodCallException("Property 'size' of argument 'item' of event {$this->name} has a wrong item. Valid: empty string or integer"); @@ -87,12 +87,12 @@ protected function validate(\stdClass $item): void } // An integer - if (!isset($item->width) || !\is_integer($item->width)) { + if (!isset($item->width) || !\is_int($item->width)) { throw new \BadMethodCallException("Property 'width' of argument 'item' of event {$this->name} has a wrong item. Valid: integer"); } // An integer - if (!isset($item->height) || !\is_integer($item->height)) { + if (!isset($item->height) || !\is_int($item->height)) { throw new \BadMethodCallException("Property 'height' of argument 'item' of event {$this->name} has a wrong item. Valid: integer"); } diff --git a/administrator/components/com_media/src/Plugin/MediaActionPlugin.php b/administrator/components/com_media/src/Plugin/MediaActionPlugin.php index d5b25a48b9b53..97aa5256e1776 100644 --- a/administrator/components/com_media/src/Plugin/MediaActionPlugin.php +++ b/administrator/components/com_media/src/Plugin/MediaActionPlugin.php @@ -40,7 +40,7 @@ class MediaActionPlugin extends CMSPlugin * * @return array * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ public static function getSubscribedEvents(): array { @@ -57,7 +57,7 @@ public static function getSubscribedEvents(): array * * @return void * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ public function onContentPrepareFormListener(PrepareFormEvent $event): void { diff --git a/administrator/components/com_menus/src/Controller/ItemController.php b/administrator/components/com_menus/src/Controller/ItemController.php index a9993ae573d17..27e515ecccfd3 100644 --- a/administrator/components/com_menus/src/Controller/ItemController.php +++ b/administrator/components/com_menus/src/Controller/ItemController.php @@ -578,8 +578,8 @@ public function getParentItem() $results = $model->getItems(); // Pad the option text with spaces using depth level as a multiplier. - for ($i = 0, $n = \count($results); $i < $n; $i++) { - $results[$i]->title = str_repeat(' - ', $results[$i]->level) . $results[$i]->title; + foreach ($results as $result) { + $result->title = str_repeat(' - ', $result->level) . $result->title; } } diff --git a/administrator/components/com_menus/src/Field/MenuParentField.php b/administrator/components/com_menus/src/Field/MenuParentField.php index cb85bd1a6ac48..432293e6c6970 100644 --- a/administrator/components/com_menus/src/Field/MenuParentField.php +++ b/administrator/components/com_menus/src/Field/MenuParentField.php @@ -99,12 +99,12 @@ protected function getOptions() } // Pad the option text with spaces using depth level as a multiplier. - for ($i = 0, $n = \count($options); $i < $n; $i++) { + foreach ($options as $option) { if ($clientId != 0) { // Allow translation of custom admin menus - $options[$i]->text = str_repeat('- ', $options[$i]->level) . Text::_($options[$i]->text); + $option->text = str_repeat('- ', $option->level) . Text::_($option->text); } else { - $options[$i]->text = str_repeat('- ', $options[$i]->level) . $options[$i]->text; + $option->text = str_repeat('- ', $option->level) . $option->text; } } diff --git a/administrator/components/com_menus/src/Field/Modal/MenuField.php b/administrator/components/com_menus/src/Field/Modal/MenuField.php index fe90c5e32dad7..683583a150444 100644 --- a/administrator/components/com_menus/src/Field/Modal/MenuField.php +++ b/administrator/components/com_menus/src/Field/Modal/MenuField.php @@ -67,7 +67,7 @@ public function __get($name) $newName = $map[$name]; @trigger_error( - sprintf( + \sprintf( 'MenuField::__get property "%s" is deprecated, and will not work in Joomla 6. Use "%s" property instead.', $name, $newName @@ -110,7 +110,7 @@ public function __set($name, $value) $newName = $map[$name]; @trigger_error( - sprintf( + \sprintf( 'MenuField::__set property "%s" is deprecated, and will not work in Joomla 6. Use "%s" property instead.', $name, $newName diff --git a/administrator/components/com_modules/src/Controller/ModuleController.php b/administrator/components/com_modules/src/Controller/ModuleController.php index 172d2dad9aa3e..90a83929d08b9 100644 --- a/administrator/components/com_modules/src/Controller/ModuleController.php +++ b/administrator/components/com_modules/src/Controller/ModuleController.php @@ -307,19 +307,18 @@ public function orderPosition() } $orders2 = []; - $n = \count($orders); - if ($n > 0) { - for ($i = 0; $i < $n; $i++) { - if (!isset($orders2[$orders[$i]->position])) { - $orders2[$orders[$i]->position] = 0; + if (\count($orders)) { + foreach ($orders as $order) { + if (!isset($orders2[$order->position])) { + $orders2[$order->position] = 0; } - $orders2[$orders[$i]->position]++; - $ord = $orders2[$orders[$i]->position]; - $title = Text::sprintf('COM_MODULES_OPTION_ORDER_POSITION', $ord, htmlspecialchars($orders[$i]->title, ENT_QUOTES, 'UTF-8')); + $orders2[$order->position]++; + $ord = $orders2[$order->position]; + $title = Text::sprintf('COM_MODULES_OPTION_ORDER_POSITION', $ord, htmlspecialchars($order->title, ENT_QUOTES, 'UTF-8')); - $html[] = $orders[$i]->position . ',' . $ord . ',' . $title; + $html[] = $order->position . ',' . $ord . ',' . $title; } } else { $html[] = $position . ',' . 1 . ',' . Text::_('JNONE'); diff --git a/administrator/components/com_modules/tmpl/modules/modal.php b/administrator/components/com_modules/tmpl/modules/modal.php index ec94112651a3e..45111f6b0d5a1 100644 --- a/administrator/components/com_modules/tmpl/modules/modal.php +++ b/administrator/components/com_modules/tmpl/modules/modal.php @@ -81,9 +81,9 @@ 'icon-trash', - 0 => 'icon-times', - 1 => 'icon-check', - 2 => 'icon-folder', + 0 => 'icon-unpublish', + 1 => 'icon-publish', + 2 => 'icon-archive', ]; foreach ($this->items as $i => $item) : $attrs = 'data-content-select data-content-type="com_modules.module"' diff --git a/administrator/components/com_newsfeeds/src/Model/NewsfeedModel.php b/administrator/components/com_newsfeeds/src/Model/NewsfeedModel.php index b165d3134b4b2..ab11a89c62fc5 100644 --- a/administrator/components/com_newsfeeds/src/Model/NewsfeedModel.php +++ b/administrator/components/com_newsfeeds/src/Model/NewsfeedModel.php @@ -271,7 +271,7 @@ public function getItem($pk = null) } if (!empty($item->id)) { - $item->tags = new TagsHelper(); + $item->tags = new TagsHelper(); $item->tags->getTagIds($item->id, 'com_newsfeeds.newsfeed'); // @todo: We probably don't need this in any client - but needs careful validation diff --git a/administrator/components/com_newsfeeds/tmpl/newsfeeds/modal.php b/administrator/components/com_newsfeeds/tmpl/newsfeeds/modal.php index e053cab87129b..e048cc5bbf434 100644 --- a/administrator/components/com_newsfeeds/tmpl/newsfeeds/modal.php +++ b/administrator/components/com_newsfeeds/tmpl/newsfeeds/modal.php @@ -76,9 +76,9 @@ 'icon-trash', - 0 => 'icon-times', - 1 => 'icon-check', - 2 => 'icon-folder', + 0 => 'icon-unpublish', + 1 => 'icon-publish', + 2 => 'icon-archive', ]; ?> items as $i => $item) : ?> diff --git a/administrator/components/com_scheduler/src/Model/TaskModel.php b/administrator/components/com_scheduler/src/Model/TaskModel.php index 20ae7564d346c..126355213878a 100644 --- a/administrator/components/com_scheduler/src/Model/TaskModel.php +++ b/administrator/components/com_scheduler/src/Model/TaskModel.php @@ -360,54 +360,100 @@ public function getTask(array $options = []): ?\stdClass $resolver = new OptionsResolver(); try { - $this->configureTaskGetterOptions($resolver); + static::configureTaskGetterOptions($resolver); } catch (\Exception $e) { } try { $options = $resolver->resolve($options); - } catch (\Exception $e) { - if ($e instanceof UndefinedOptionsException || $e instanceof InvalidOptionsException) { - throw $e; - } + } catch (UndefinedOptionsException | InvalidOptionsException $e) { + throw $e; } - $db = $this->getDatabase(); - $now = Factory::getDate()->toSql(); - - // Get lock on the table to help with concurrency issues - $db->lockTable(self::TASK_TABLE); + $db = $this->getDatabase(); + $now = Factory::getDate()->toSql(); + $affectedRows = 0; - // If concurrency is not allowed, we only get a task if another one does not have a "lock" - if (!$options['allowConcurrent']) { - // Get count of locked (presumed running) tasks - $lockCountQuery = $db->getQuery(true) - ->from($db->quoteName(self::TASK_TABLE)) - ->select('COUNT(id)') - ->where($db->quoteName('locked') . ' IS NOT NULL'); - - try { - $runningCount = $db->setQuery($lockCountQuery)->loadResult(); - } catch (\RuntimeException $e) { - $db->unlockTables(); + try { + $db->lockTable(self::TASK_TABLE); + if (!$options['allowConcurrent'] && $this->hasRunningTasks($db)) { return null; } - if ($runningCount !== 0) { - $db->unlockTables(); + $lockQuery = $this->buildLockQuery($db, $now, $options); - return null; + if ($options['id'] > 0) { + $lockQuery->where($db->quoteName('id') . ' = :taskId') + ->bind(':taskId', $options['id'], ParameterType::INTEGER); + } else { + $id = $this->getNextTaskId($db, $now, $options); + if (\count($id) === 0) { + return null; + } + $lockQuery->where($db->quoteName('id') . ' = :taskId') + ->bind(':taskId', $id, ParameterType::INTEGER); } + + $db->setQuery($lockQuery)->execute(); + $affectedRows = $db->getAffectedRows(); + } catch (\RuntimeException $e) { + return null; + } finally { + $db->unlockTables(); + } + + if ($affectedRows != 1) { + return null; + } + + return $this->fetchTask($db, $now); + } + + /** + * Checks if there are any running tasks in the database. + * + * @param \JDatabaseDriver $db The database driver to use. + * @return bool True if there are running tasks, false otherwise. + * @since __DEPLOY_VERSION__ + */ + private function hasRunningTasks($db): bool + { + $lockCountQuery = $db->getQuery(true) + ->select('COUNT(id)') + ->from($db->quoteName(self::TASK_TABLE)) + ->where($db->quoteName('locked') . ' IS NOT NULL') + ->where($db->quoteName('state') . ' = 1'); + + try { + $runningCount = $db->setQuery($lockCountQuery)->loadResult(); + } catch (\RuntimeException $e) { + return false; } - $lockQuery = $db->getQuery(true); + return $runningCount != 0; + } - $lockQuery->update($db->quoteName(self::TASK_TABLE)) + /** + * Builds a query to lock a task. + * + * @param Database $db The database object. + * @param string $now The current time. + * @param array $options The options for building the query. + * - includeCliExclusive: Whether to include CLI exclusive tasks. + * - bypassScheduling: Whether to bypass scheduling. + * - allowDisabled: Whether to allow disabled tasks. + * - id: The ID of the task. + * @return Query The lock query. + * @since __DEPLOY_VERSION__ + */ + private function buildLockQuery($db, $now, $options) + { + $lockQuery = $db->getQuery(true) + ->update($db->quoteName(self::TASK_TABLE)) ->set($db->quoteName('locked') . ' = :now1') ->bind(':now1', $now); - // Array of all active routine ids $activeRoutines = array_map( static function (TaskOption $taskOption): string { return $taskOption->id; @@ -415,10 +461,8 @@ static function (TaskOption $taskOption): string { SchedulerHelper::getTaskOptions()->options ); - // "Orphaned" tasks are not a part of the task queue! $lockQuery->whereIn($db->quoteName('type'), $activeRoutines, ParameterType::STRING); - // If directed, exclude CLI exclusive tasks if (!$options['includeCliExclusive']) { $lockQuery->where($db->quoteName('cli_exclusive') . ' = 0'); } @@ -428,77 +472,91 @@ static function (TaskOption $taskOption): string { ->bind(':now2', $now); } - if ($options['allowDisabled']) { - $lockQuery->whereIn($db->quoteName('state'), [0, 1]); - } else { - $lockQuery->where($db->quoteName('state') . ' = 1'); - } + $stateCondition = $options['allowDisabled'] ? [0, 1] : [1]; + $lockQuery->whereIn($db->quoteName('state'), $stateCondition); - if ($options['id'] > 0) { - $lockQuery->where($db->quoteName('id') . ' = :taskId') - ->bind(':taskId', $options['id'], ParameterType::INTEGER); - } else { - // Pick from the front of the task queue if no 'id' is specified - // Get the id of the next task in the task queue - $idQuery = $db->getQuery(true) - ->from($db->quoteName(self::TASK_TABLE)) - ->select($db->quoteName('id')) - ->where($db->quoteName('state') . ' = 1') - ->order($db->quoteName('priority') . ' DESC') - ->order($db->quoteName('next_execution') . ' ASC') - ->setLimit(1); - - try { - $ids = $db->setQuery($idQuery)->loadColumn(); - } catch (\RuntimeException $e) { - $db->unlockTables(); + return $lockQuery; + } - return null; - } + /** + * Retrieves the ID of the next task based on the given criteria. + * + * @param \JDatabaseDriver $db The database object. + * @param string $now The current time. + * @param array $options The options for retrieving the next task. + * - includeCliExclusive: Whether to include CLI exclusive tasks. + * - bypassScheduling: Whether to bypass scheduling. + * - allowDisabled: Whether to allow disabled tasks. + * @return array The ID of the next task, or an empty array if no task is found. + * + * @since __DEPLOY_VERSION__ + * @throws \RuntimeException If there is an error executing the query. + */ + private function getNextTaskId($db, $now, $options) + { + $idQuery = $db->getQuery(true) + ->from($db->quoteName(self::TASK_TABLE)) + ->select($db->quoteName('id')); - if (\count($ids) === 0) { - $db->unlockTables(); + $activeRoutines = array_map( + static function (TaskOption $taskOption): string { + return $taskOption->id; + }, + SchedulerHelper::getTaskOptions()->options + ); - return null; - } + $idQuery->whereIn($db->quoteName('type'), $activeRoutines, ParameterType::STRING); - $lockQuery->whereIn($db->quoteName('id'), $ids); + if (!$options['includeCliExclusive']) { + $idQuery->where($db->quoteName('cli_exclusive') . ' = 0'); } - try { - $db->setQuery($lockQuery)->execute(); - } catch (\RuntimeException $e) { - } finally { - $affectedRows = $db->getAffectedRows(); - - $db->unlockTables(); + if (!$options['bypassScheduling']) { + $idQuery->where($db->quoteName('next_execution') . ' <= :now2') + ->bind(':now2', $now); } - if ($affectedRows != 1) { - /* - // @todo - // ? Fatal failure handling here? - // ! Question is, how? If we check for tasks running beyond there time here, we have no way of - // ! what's already been notified (since we're not auto-unlocking/recovering tasks anymore). - // The solution __may__ be in a "last_successful_finish" (or something) column. - */ + $stateCondition = $options['allowDisabled'] ? [0, 1] : [1]; + $idQuery->whereIn($db->quoteName('state'), $stateCondition); - return null; - } + $idQuery->where($db->quoteName('next_execution') . ' IS NOT NULL') + ->order($db->quoteName('priority') . ' DESC') + ->order($db->quoteName('next_execution') . ' ASC') + ->setLimit(1); - $getQuery = $db->getQuery(true); + try { + return $db->setQuery($idQuery)->loadColumn(); + } catch (\RuntimeException $e) { + return []; + } + } - $getQuery->select('*') + /** + * Fetches a task from the database based on the current time. + * + * @param \JDatabaseDriver $db The database driver to use. + * @param string $now The current time in the database's time format. + * @return \stdClass|null The fetched task object, or null if no task was found. + * @since __DEPLOY_VERSION__ + * @throws \RuntimeException If there was an error executing the query. + */ + private function fetchTask($db, $now): ?\stdClass + { + $getQuery = $db->getQuery(true) + ->select('*') ->from($db->quoteName(self::TASK_TABLE)) ->where($db->quoteName('locked') . ' = :now') ->bind(':now', $now); - $task = $db->setQuery($getQuery)->loadObject(); + try { + $task = $db->setQuery($getQuery)->loadObject(); + } catch (\RuntimeException $e) { + return null; + } $task->execution_rules = json_decode($task->execution_rules); $task->cron_rules = json_decode($task->cron_rules); - - $task->taskOption = SchedulerHelper::getTaskOptions()->findOption($task->type); + $task->taskOption = SchedulerHelper::getTaskOptions()->findOption($task->type); return $task; } @@ -623,7 +681,7 @@ private function processExecutionRules(array $unprocessedRules): array */ private function buildExecutionRules(array $executionRules): array { - // Maps interval strings, use with sprintf($map[intType], $interval) + // Maps interval strings, use with \sprintf($map[intType], $interval) $intervalStringMap = [ 'minutes' => 'PT%dM', 'hours' => 'PT%dH', @@ -640,7 +698,7 @@ private function buildExecutionRules(array $executionRules): array // Rule type for intervals interval- $intervalType = explode('-', $ruleType)[1]; $interval = $executionRules["interval-$intervalType"]; - $buildExpression = sprintf($intervalStringMap[$intervalType], $interval); + $buildExpression = \sprintf($intervalStringMap[$intervalType], $interval); } if ($ruleClass === 'cron-expression') { diff --git a/administrator/components/com_scheduler/src/Model/TasksModel.php b/administrator/components/com_scheduler/src/Model/TasksModel.php index d792bafe7d32f..92bc2780ff135 100644 --- a/administrator/components/com_scheduler/src/Model/TasksModel.php +++ b/administrator/components/com_scheduler/src/Model/TasksModel.php @@ -270,7 +270,7 @@ static function (TaskOption $taskOption): string { if (is_numeric($locked) && $locked != 0) { $now = Factory::getDate('now', 'GMT'); $timeout = ComponentHelper::getParams('com_scheduler')->get('timeout', 300); - $timeout = new \DateInterval(sprintf('PT%dS', $timeout)); + $timeout = new \DateInterval(\sprintf('PT%dS', $timeout)); $timeoutThreshold = (clone $now)->sub($timeout)->toSql(); $now = $now->toSql(); diff --git a/administrator/components/com_scheduler/src/Task/Task.php b/administrator/components/com_scheduler/src/Task/Task.php index bfd16a0989658..e4d58a933a734 100644 --- a/administrator/components/com_scheduler/src/Task/Task.php +++ b/administrator/components/com_scheduler/src/Task/Task.php @@ -310,7 +310,7 @@ public function acquireLock(): bool $now = Factory::getDate('now', 'GMT'); $timeout = ComponentHelper::getParams('com_scheduler')->get('timeout', 300); - $timeout = new \DateInterval(sprintf('PT%dS', $timeout)); + $timeout = new \DateInterval(\sprintf('PT%dS', $timeout)); $timeoutThreshold = (clone $now)->sub($timeout)->toSql(); $now = $now->toSql(); diff --git a/administrator/components/com_scheduler/src/Task/TaskOption.php b/administrator/components/com_scheduler/src/Task/TaskOption.php index c085e23c0546b..d8bc2bd7257f7 100644 --- a/administrator/components/com_scheduler/src/Task/TaskOption.php +++ b/administrator/components/com_scheduler/src/Task/TaskOption.php @@ -97,7 +97,7 @@ public function __get(string $name) if ($name === 'type') { try { Log::add( - sprintf( + \sprintf( 'The %1$s property is deprecated. Use %2$s instead.', $name, 'id' diff --git a/administrator/components/com_scheduler/src/Traits/TaskPluginTrait.php b/administrator/components/com_scheduler/src/Traits/TaskPluginTrait.php index 2de696411a005..01ab8b9d1e0e3 100644 --- a/administrator/components/com_scheduler/src/Traits/TaskPluginTrait.php +++ b/administrator/components/com_scheduler/src/Traits/TaskPluginTrait.php @@ -115,7 +115,7 @@ public function enhanceTaskItemForm($context, $data = null): bool $form = $context; } else { throw new \InvalidArgumentException( - sprintf( + \sprintf( 'Argument 0 of %1$s must be an instance of %2$s or %3$s', __METHOD__, EventInterface::class, @@ -284,7 +284,7 @@ public function standardRoutineHandler(ExecuteTaskEvent $event): void || $method->getReturnType()->getName() !== 'int' ) { $this->logTask( - sprintf( + \sprintf( 'Incorrect routine method signature for %1$s(). See checks in %2$s()', $method->getName(), __METHOD__ @@ -306,7 +306,7 @@ public function standardRoutineHandler(ExecuteTaskEvent $event): void } } else { $this->logTask( - sprintf( + \sprintf( 'Incorrectly configured TASKS_MAP in class %s. Missing valid method for `routine_id` %s', static::class, $routineId diff --git a/administrator/components/com_templates/src/Model/TemplateModel.php b/administrator/components/com_templates/src/Model/TemplateModel.php index 4b42757213d9a..a5ee5bcbdcd12 100644 --- a/administrator/components/com_templates/src/Model/TemplateModel.php +++ b/administrator/components/com_templates/src/Model/TemplateModel.php @@ -1525,7 +1525,7 @@ public function cropImage($file, $w, $h, $x, $y) try { $image = new Image($path); - $properties = $image->getImageFileProperties($path); + $properties = Image::getImageFileProperties($path); switch ($properties->mime) { case 'image/webp': @@ -1570,7 +1570,7 @@ public function resizeImage($file, $width, $height) try { $image = new Image($path); - $properties = $image->getImageFileProperties($path); + $properties = Image::getImageFileProperties($path); switch ($properties->mime) { case 'image/webp': diff --git a/administrator/components/com_users/src/DataShape/DataShapeObject.php b/administrator/components/com_users/src/DataShape/DataShapeObject.php index c714d5fcde4d0..464affca2b754 100644 --- a/administrator/components/com_users/src/DataShape/DataShapeObject.php +++ b/administrator/components/com_users/src/DataShape/DataShapeObject.php @@ -27,7 +27,7 @@ abstract class DataShapeObject implements \ArrayAccess public function __construct(array $array = []) { if (!\is_array($array) && !($array instanceof self)) { - throw new \InvalidArgumentException(sprintf('%s needs an array or a %s object', __METHOD__, __CLASS__)); + throw new \InvalidArgumentException(\sprintf('%s needs an array or a %s object', __METHOD__, __CLASS__)); } foreach (($array instanceof self) ? $array->asArray() : $array as $k => $v) { @@ -59,7 +59,7 @@ public function asArray(): array public function merge($newValues): self { if (!\is_array($newValues) && !($newValues instanceof self)) { - throw new \InvalidArgumentException(sprintf('%s needs an array or a %s object', __METHOD__, __CLASS__)); + throw new \InvalidArgumentException(\sprintf('%s needs an array or a %s object', __METHOD__, __CLASS__)); } foreach (($newValues instanceof self) ? $newValues->asArray() : $newValues as $k => $v) { @@ -94,7 +94,7 @@ public function __get($name) return $this->{$name}; } - throw new \InvalidArgumentException(sprintf('Property %s not found in %s', $name, __CLASS__)); + throw new \InvalidArgumentException(\sprintf('Property %s not found in %s', $name, __CLASS__)); } /** @@ -118,7 +118,7 @@ public function __set($name, $value) $this->{$name} = $value; } - throw new \InvalidArgumentException(sprintf('Property %s not found in %s', $name, __CLASS__)); + throw new \InvalidArgumentException(\sprintf('Property %s not found in %s', $name, __CLASS__)); } /** @@ -186,6 +186,6 @@ public function offsetSet($offset, $value): void */ public function offsetUnset($offset): void { - throw new \LogicException(sprintf('You cannot unset members of %s', __CLASS__)); + throw new \LogicException(\sprintf('You cannot unset members of %s', __CLASS__)); } } diff --git a/administrator/components/com_users/src/Field/GroupparentField.php b/administrator/components/com_users/src/Field/GroupparentField.php index 2537c7047cc17..905f1a2971204 100644 --- a/administrator/components/com_users/src/Field/GroupparentField.php +++ b/administrator/components/com_users/src/Field/GroupparentField.php @@ -84,11 +84,11 @@ protected function getOptions() $isSuperAdmin = $this->getCurrentUser()->authorise('core.admin'); // Pad the option text with spaces using depth level as a multiplier. - for ($i = 0, $n = \count($options); $i < $n; $i++) { + foreach ($options as $i => $option) { // Show groups only if user is super admin or group is not super admin - if ($isSuperAdmin || !Access::checkGroup($options[$i]->id, 'core.admin')) { - $options[$i]->value = $options[$i]->id; - $options[$i]->text = str_repeat('- ', $options[$i]->level) . $options[$i]->title; + if ($isSuperAdmin || !Access::checkGroup($option->id, 'core.admin')) { + $option->value = $option->id; + $option->text = str_repeat('- ', $option->level) . $option->title; } else { unset($options[$i]); } diff --git a/administrator/components/com_users/src/Model/BackupcodesModel.php b/administrator/components/com_users/src/Model/BackupcodesModel.php index 5f16e45417570..cae3ab133197b 100644 --- a/administrator/components/com_users/src/Model/BackupcodesModel.php +++ b/administrator/components/com_users/src/Model/BackupcodesModel.php @@ -90,7 +90,7 @@ public function regenerateBackupCodes(?User $user = null): void for ($i = 0; $i < 10; $i++) { // Each backup code is 2 groups of 4 digits - $backupCodes[$i] = sprintf('%04u%04u', random_int(0, 9999), random_int(0, 9999)); + $backupCodes[$i] = \sprintf('%04u%04u', random_int(0, 9999), random_int(0, 9999)); } // Save the backup codes to the database and update the cache @@ -230,17 +230,17 @@ public function isBackupCode($code, ?User $user = null): bool $realLength = \count($codes); $restLength = 10 - $realLength; - for ($i = 0; $i < $realLength; $i++) { - if (hash_equals($codes[$i], $code)) { + foreach ($codes as $value) { + if (hash_equals($value, $code)) { // This may seem redundant but makes sure both branches of the if-block are isochronous $result = $result || true; $newArray[] = ''; - $dummyArray[] = $codes[$i]; + $dummyArray[] = $value; } else { // This may seem redundant but makes sure both branches of the if-block are isochronous $result = $result || false; $dummyArray[] = ''; - $newArray[] = $codes[$i]; + $newArray[] = $value; } } diff --git a/administrator/components/com_users/src/Model/LevelModel.php b/administrator/components/com_users/src/Model/LevelModel.php index 8e557d36b7774..066bd36478bd8 100644 --- a/administrator/components/com_users/src/Model/LevelModel.php +++ b/administrator/components/com_users/src/Model/LevelModel.php @@ -300,11 +300,11 @@ public function validate($form, $data, $group = null) $rules = ArrayHelper::toInteger($rules); - for ($i = 0, $n = \count($groups); $i < $n; ++$i) { - if (Access::checkGroup((int) $groups[$i]->id, 'core.admin')) { - if (\in_array((int) $groups[$i]->id, $rules) && !\in_array((int) $groups[$i]->id, $data['rules'])) { - $data['rules'][] = (int) $groups[$i]->id; - } elseif (!\in_array((int) $groups[$i]->id, $rules) && \in_array((int) $groups[$i]->id, $data['rules'])) { + foreach ($groups as $value) { + if (Access::checkGroup((int) $value->id, 'core.admin')) { + if (\in_array((int) $value->id, $rules) && !\in_array((int) $value->id, $data['rules'])) { + $data['rules'][] = (int) $value->id; + } elseif (!\in_array((int) $value->id, $rules) && \in_array((int) $value->id, $data['rules'])) { $this->setError(Text::_('JLIB_USER_ERROR_NOT_SUPERADMIN')); return false; diff --git a/administrator/components/com_users/src/Model/MailModel.php b/administrator/components/com_users/src/Model/MailModel.php index 6de5f948c44a6..b6f5d72597544 100644 --- a/administrator/components/com_users/src/Model/MailModel.php +++ b/administrator/components/com_users/src/Model/MailModel.php @@ -103,7 +103,6 @@ public function send() $app = Factory::getApplication(); $data = $app->getInput()->post->get('jform', [], 'array'); $user = $this->getCurrentUser(); - $access = new Access(); $db = $this->getDatabase(); $language = Factory::getLanguage(); @@ -129,7 +128,7 @@ public function send() } // Get users in the group out of the ACL, if group is provided. - $to = $grp !== 0 ? $access->getUsersByGroup($grp, $recurse) : []; + $to = $grp !== 0 ? Access::getUsersByGroup($grp, $recurse) : []; // When group is provided but no users are found in the group. if ($grp !== 0 && !$to) { diff --git a/administrator/components/com_users/src/Model/MethodModel.php b/administrator/components/com_users/src/Model/MethodModel.php index 7b2d3ce02c176..b00bda2b1a2a8 100644 --- a/administrator/components/com_users/src/Model/MethodModel.php +++ b/administrator/components/com_users/src/Model/MethodModel.php @@ -176,7 +176,7 @@ public function getPageTitle(): string break; default: - $key = sprintf('COM_USERS_MFA_%s_PAGE_HEAD', $task); + $key = \sprintf('COM_USERS_MFA_%s_PAGE_HEAD', $task); break; } diff --git a/administrator/components/com_users/src/Model/MethodsModel.php b/administrator/components/com_users/src/Model/MethodsModel.php index ba0d086118f65..26cc80e566330 100644 --- a/administrator/components/com_users/src/Model/MethodsModel.php +++ b/administrator/components/com_users/src/Model/MethodsModel.php @@ -170,7 +170,7 @@ public function formatRelative(?string $dateTimeText): string } } - return sprintf($containerString, $jDate->format($formatString, true)); + return \sprintf($containerString, $jDate->format($formatString, true)); } /** diff --git a/administrator/components/com_users/src/Model/UserModel.php b/administrator/components/com_users/src/Model/UserModel.php index e6204d3064bca..889add8c3d370 100644 --- a/administrator/components/com_users/src/Model/UserModel.php +++ b/administrator/components/com_users/src/Model/UserModel.php @@ -915,7 +915,7 @@ public function getAssignedGroups($userId = null) public function getOtpConfig($userId = null) { @trigger_error( - sprintf( + \sprintf( '%s() is deprecated. Use \Joomla\Component\Users\Administrator\Helper\Mfa::getUserMfaRecords() instead.', __METHOD__ ), @@ -946,7 +946,7 @@ public function getOtpConfig($userId = null) public function setOtpConfig($userId, $otpConfig) { @trigger_error( - sprintf( + \sprintf( '%s() is deprecated. Multi-factor Authentication actions are handled by plugins in the multifactorauth folder.', __METHOD__ ), @@ -969,7 +969,7 @@ public function setOtpConfig($userId, $otpConfig) public function getOtpConfigEncryptionKey() { @trigger_error( - sprintf( + \sprintf( '%s() is deprecated. Use \Joomla\CMS\Factory::getApplication()->get(\'secret\') instead', __METHOD__ ), @@ -995,7 +995,7 @@ public function getOtpConfigEncryptionKey() public function getTwofactorform($userId = null) { @trigger_error( - sprintf( + \sprintf( '%s() is deprecated. Use \Joomla\Component\Users\Administrator\Helper\Mfa::getConfigurationInterface()', __METHOD__ ), @@ -1021,7 +1021,7 @@ public function getTwofactorform($userId = null) public function generateOteps($userId, $count = 10) { @trigger_error( - sprintf( + \sprintf( '%s() is deprecated. See \Joomla\Component\Users\Administrator\Model\BackupcodesModel::saveBackupCodes()', __METHOD__ ), @@ -1049,7 +1049,7 @@ public function generateOteps($userId, $count = 10) public function isValidSecretKey($userId, $secretKey, $options = []) { @trigger_error( - sprintf( + \sprintf( '%s() is deprecated. Multi-factor Authentication actions are handled by plugins in the multifactorauth folder.', __METHOD__ ), @@ -1076,7 +1076,7 @@ public function isValidSecretKey($userId, $secretKey, $options = []) public function isValidOtep($userId, $otep, $otpConfig = null) { @trigger_error( - sprintf( + \sprintf( '%s() is deprecated. Multi-factor Authentication actions are handled by plugins in the multifactorauth folder.', __METHOD__ ), diff --git a/administrator/components/com_users/src/View/Method/HtmlView.php b/administrator/components/com_users/src/View/Method/HtmlView.php index 7a0c52c9925df..55b96ebfa07da 100644 --- a/administrator/components/com_users/src/View/Method/HtmlView.php +++ b/administrator/components/com_users/src/View/Method/HtmlView.php @@ -199,7 +199,7 @@ function ($x) { $button = (new LinkButton('user-mfa-edit-cancel')) ->url( Route::_( - sprintf( + \sprintf( "index.php?option=com_users&task=method.regenerateBackupCodes&user_id=%s&%s=1&returnurl=%s", $this->user->id, Factory::getApplication()->getFormToken(), diff --git a/administrator/language/en-GB/guidedtours.joomla_whatsnew_5_2.ini b/administrator/language/en-GB/guidedtours.joomla_whatsnew_5_2.ini new file mode 100644 index 0000000000000..26d043bf581d0 --- /dev/null +++ b/administrator/language/en-GB/guidedtours.joomla_whatsnew_5_2.ini @@ -0,0 +1,2 @@ +COM_GUIDEDTOURS_TOUR_WHATSNEW_5_2_DESCRIPTION = "

Welcome to Joomla 5.2!

\"The

Guided Tours Updates

Auto-start Tours

This feature will allow you to create your own auto-start Guided Tour. The contextual tour can be opted out for one or all users. Tours can be restarted from the Guided Tours menu.

Enhancements

  • For clarity, the Step Counter was positioned first in the tour header.
  • The modal window resizes automatically to accommodate larger content and images.

Core Updates

The new all-in-one 'Articles' module

Use one module to display latest, most read, specific or archived articles, from select categories - with filters, tags and more...

From Content -> Site Modules, create a new module of type 'Articles'.

Mail Template Layout

Take it a step further by creating an entirely unique layout (including logo) which can be applied to one or all mail templates.

From Global Configuration -> Mail Templates, layouts can be defined in HTML.

Other Enhancements and Fixes

  • Nested Subforms - Allows the nesting of Subform inside a Subform Custom Field.
  • Total Count - Shows the count and total number of list items in the console.
\"Mail
" +COM_GUIDEDTOURS_TOUR_WHATSNEW_5_2_TITLE = "What’s New in Joomla 5.2!" diff --git a/administrator/language/en-GB/guidedtours.joomla_whatsnew_5_2_steps.ini b/administrator/language/en-GB/guidedtours.joomla_whatsnew_5_2_steps.ini new file mode 100644 index 0000000000000..b544d56d8eeb1 --- /dev/null +++ b/administrator/language/en-GB/guidedtours.joomla_whatsnew_5_2_steps.ini @@ -0,0 +1,2 @@ +COM_GUIDEDTOURS_TOUR_WHATSNEW_5_2_STEP_0_DESCRIPTION = "

Joomla 5.2 Full Release Notes

View the full release notes on joomla.org


Help and Information

Many resources to help you can be found here together with additional links to more resources, documentation, support and how to become involved in Joomla.

" +COM_GUIDEDTOURS_TOUR_WHATSNEW_5_2_STEP_0_TITLE = "More Information and Help" diff --git a/administrator/language/en-GB/lib_joomla.ini b/administrator/language/en-GB/lib_joomla.ini index 695d505929b33..9730562cebd67 100644 --- a/administrator/language/en-GB/lib_joomla.ini +++ b/administrator/language/en-GB/lib_joomla.ini @@ -147,6 +147,7 @@ JLIB_DATABASE_ERROR_MENU_CANNOT_UNSET_DEFAULT="The Language parameter for this m JLIB_DATABASE_ERROR_MENU_CANNOT_UNSET_DEFAULT_DEFAULT="At least one menu item has to be set as Default." JLIB_DATABASE_ERROR_MENU_DEFAULT_CHECKIN_USER_MISMATCH="The current home menu for this language is checked out." JLIB_DATABASE_ERROR_MENU_HOME_NOT_COMPONENT="The home menu item must be a component." +; The following string is deprecated and will be removed with 7.0 JLIB_DATABASE_ERROR_MENU_HOME_NOT_UNIQUE_IN_MENU="A menu should have only one Default home." JLIB_DATABASE_ERROR_MENU_ROOT_ALIAS_COMPONENT="A first level menu item alias can't be 'component'." JLIB_DATABASE_ERROR_MENU_ROOT_ALIAS_FOLDER="A first level menu item alias can't be '%s' because '%s' is a sub-folder of your Joomla installation folder." @@ -445,6 +446,10 @@ JLIB_HTML_FEATURED_PENDING_ITEM="Featured, but is Pending." JLIB_HTML_FEATURED_STARTED="Start: %s" JLIB_HTML_GOTO_PAGE="Go to page %s" JLIB_HTML_GOTO_POSITION="Go to %s page" +JLIB_HTML_GOTO_POSITION_END="Go to last page" +JLIB_HTML_GOTO_POSITION_NEXT="Go to next page" +JLIB_HTML_GOTO_POSITION_PREVIOUS="Go to previous page" +JLIB_HTML_GOTO_POSITION_START="Go to first page" JLIB_HTML_ITEM_PUBLISHED_BUT_CATEGORY_TRASHED="Published but the category is trashed." JLIB_HTML_ITEM_PUBLISHED_BUT_CATEGORY_UNPUBLISHED="Published but the category is not published." JLIB_HTML_MOVE_DOWN="Move Down" diff --git a/administrator/language/en-GB/plg_editors_tinymce.ini b/administrator/language/en-GB/plg_editors_tinymce.ini index 8426a30d3013c..75b037de59e38 100644 --- a/administrator/language/en-GB/plg_editors_tinymce.ini +++ b/administrator/language/en-GB/plg_editors_tinymce.ini @@ -45,11 +45,11 @@ PLG_TINY_FIELD_HTMLWIDTH_LABEL="HTML Width" PLG_TINY_FIELD_LABEL_ADVANCEDPARAMS="Advanced" PLG_TINY_FIELD_LANGCODE_LABEL="Language Code" PLG_TINY_FIELD_LANGSELECT_LABEL="Automatic Language Selection" +PLG_TINY_FIELD_LINK_CLASSES_LIST_DESC="Add default classes to the class dropdown in the create link dialog." +PLG_TINY_FIELD_LINK_CLASSES_LIST_LABEL="Link Classes List" PLG_TINY_FIELD_LINK_CLASS_LIST_LABEL="Class List" PLG_TINY_FIELD_LINK_CLASS_NAME_LABEL="Name" PLG_TINY_FIELD_LINK_CLASS_NONE="None" -PLG_TINY_FIELD_LINK_CLASSES_LIST_DESC="Add default classes to the class dropdown in the create link dialog." -PLG_TINY_FIELD_LINK_CLASSES_LIST_LABEL="Link Classes List" PLG_TINY_FIELD_NEWLINES_LABEL="New Lines" PLG_TINY_FIELD_NUMBER_OF_SETS_LABEL="Number of Sets" PLG_TINY_FIELD_PASTE_AS_TEXT_LABEL="Paste As Text" diff --git a/api/index.php b/api/index.php index e8a1306cbcdae..3785e00f2cf5c 100644 --- a/api/index.php +++ b/api/index.php @@ -15,7 +15,7 @@ if (version_compare(PHP_VERSION, JOOMLA_MINIMUM_PHP, '<')) { header('HTTP/1.1 500 Internal Server Error'); echo json_encode( - ['error' => sprintf('Joomla requires PHP version %s to run', JOOMLA_MINIMUM_PHP)] + ['error' => \sprintf('Joomla requires PHP version %s to run', JOOMLA_MINIMUM_PHP)] ); return; diff --git a/build/.eslintrc b/build/.eslintrc index 24f5eac974cce..1be12f13c4f0d 100644 --- a/build/.eslintrc +++ b/build/.eslintrc @@ -19,7 +19,7 @@ // Additional global variables your script accesses during execution "globals": { "Joomla": true, - "MediaManager" : true, + "MediaManager": true, "bootstrap": true }, // Rule overrides @@ -52,24 +52,24 @@ ] }, "overrides": [ - { - "files": ["tests/**/*.js"], - "rules": { - "no-undef": ["off"], - "import/no-extraneous-dependencies": ["off"] - } - }, - { - "files": ["tests/System/support/index.js"], - "rules": { - "no-console": ["off"] - } - }, - { - "files": ["tests/System/support/commands/db.js","tests/System/plugins/index.js"], - "rules": { - "no-useless-escape": ["off"] - } - } + { + "files": ["tests/**/*.js", "tests/**/*.mjs"], + "rules": { + "no-undef": ["off"], + "import/no-extraneous-dependencies": ["off"] + } + }, + { + "files": ["tests/System/support/index.js"], + "rules": { + "no-console": ["off"] + } + }, + { + "files": ["tests/System/support/commands/db.mjs"], + "rules": { + "no-useless-escape": ["off"] + } + } ] } diff --git a/build/build.php b/build/build.php index a83920b8a6d89..2124b75234ca6 100644 --- a/build/build.php +++ b/build/build.php @@ -148,6 +148,9 @@ function clean_checkout(string $dir) system('rm -rf libraries/vendor/joomla/*/Tests'); system('rm -rf libraries/vendor/joomla/*/ruleset.xml'); + // maximebf/debugbar + system('rm -f libraries/vendor/maximebf/debugbar/chromedriver'); + // testing sampledata system('rm -rf plugins/sampledata/testing'); system('rm -rf images/sampledata/parks'); diff --git a/build/helpTOC.php b/build/helpTOC.php index 70a6f2d35e55c..ad8915276a86a 100644 --- a/build/helpTOC.php +++ b/build/helpTOC.php @@ -89,14 +89,14 @@ protected function doExecute(InputInterface $input, OutputInterface $output): in $cleanMembers = []; - $io->comment(sprintf('Loop through docs wiki categories since Joomla Version %d.0 - Takes a while ...', Version::MAJOR_VERSION)); + $io->comment(\sprintf('Loop through docs wiki categories since Joomla Version %d.0 - Takes a while ...', Version::MAJOR_VERSION)); // Loop through the Versions since 5.0 to get all HelpTocs - Temporary fix for ($helpScreenMinor=Version::MINOR_VERSION; $helpScreenMinor >= 0; $helpScreenMinor--) { // Get the category members (local hack) $categoryMembers = $mediawiki->categories->getCategoryMembers( - sprintf('Category:Help_screen_%s.%s', Version::MAJOR_VERSION, $helpScreenMinor), + \sprintf('Category:Help_screen_%s.%s', Version::MAJOR_VERSION, $helpScreenMinor), null, 'max' ); @@ -115,7 +115,7 @@ protected function doExecute(InputInterface $input, OutputInterface $output): in */ // Strip the namespace prefix off the titles and replace spaces with underscores - $namespace = sprintf('Help%d.x:', Version::MAJOR_VERSION); + $namespace = \sprintf('Help%d.x:', Version::MAJOR_VERSION); foreach ($members as $member) { $cleanMembers[str_replace([$namespace, ' '], ['', '_'], $member)] = trim(str_replace($namespace, ' ', $member)); @@ -142,15 +142,15 @@ protected function doExecute(InputInterface $input, OutputInterface $output): in $string = strtoupper($key); // Validate the key exists - $io->comment(sprintf('Validating key COM_ADMIN_HELP_%s', $string)); + $io->comment(\sprintf('Validating key COM_ADMIN_HELP_%s', $string)); if ($language->hasKey('COM_ADMIN_HELP_' . $string)) { - $io->comment(sprintf('Adding %s', $string)); + $io->comment(\sprintf('Adding %s', $string)); $toc[$key] = $string; } else { // We check the string for words in singular/plural form and check again - $io->comment(sprintf('Inflecting %s', $string)); + $io->comment(\sprintf('Inflecting %s', $string)); $inflected = ''; @@ -170,10 +170,10 @@ protected function doExecute(InputInterface $input, OutputInterface $output): in // Now try to validate the key if ($inflected !== '') { - $io->comment(sprintf('Validating key COM_ADMIN_HELP_%s', $inflected)); + $io->comment(\sprintf('Validating key COM_ADMIN_HELP_%s', $inflected)); if ($language->hasKey('COM_ADMIN_HELP_' . $inflected)) { - $io->comment(sprintf('Adding %s', $inflected)); + $io->comment(\sprintf('Adding %s', $inflected)); $toc[$key] = $inflected; } @@ -181,7 +181,7 @@ protected function doExecute(InputInterface $input, OutputInterface $output): in } } - $io->comment(sprintf('Number of strings: %d', \count($toc))); + $io->comment(\sprintf('Number of strings: %d', \count($toc))); // JSON encode the file and write it to JPATH_ADMINISTRATOR/help/en-GB/toc.json file_put_contents(JPATH_ADMINISTRATOR . '/help/en-GB/toc.json', json_encode($toc)); @@ -197,9 +197,9 @@ protected function doExecute(InputInterface $input, OutputInterface $output): in // write missing strings to JPATH_BASE/tmp/missing-helptoc.txt file_put_contents(JPATH_BASE . '/tmp/missing-helptoc.txt', $str_missing); - $io->caution(sprintf('Number of media-wiki articles without string: %d', \count($missing))); + $io->caution(\sprintf('Number of media-wiki articles without string: %d', \count($missing))); - $io->note(sprintf('Missing strings are saved in: %s and should be revised and added to %s', 'tmp/missing-helptoc.txt', 'administrator/language/en-GB/com_admin.ini')); + $io->note(\sprintf('Missing strings are saved in: %s and should be revised and added to %s', 'tmp/missing-helptoc.txt', 'administrator/language/en-GB/com_admin.ini')); $io->caution('TODO: For a complete TOC, please run this script again after adding the missing language strings!'); diff --git a/build/media_source/com_guidedtours/images/5_2/enhancedtourheader.png b/build/media_source/com_guidedtours/images/5_2/enhancedtourheader.png new file mode 100644 index 0000000000000..061bdb9602d73 Binary files /dev/null and b/build/media_source/com_guidedtours/images/5_2/enhancedtourheader.png differ diff --git a/build/media_source/com_guidedtours/images/5_2/mailtemplate.png b/build/media_source/com_guidedtours/images/5_2/mailtemplate.png new file mode 100644 index 0000000000000..93b6f79bf0748 Binary files /dev/null and b/build/media_source/com_guidedtours/images/5_2/mailtemplate.png differ diff --git a/components/com_banners/src/Service/Router.php b/components/com_banners/src/Service/Router.php index ad7b74fa6b18d..33e96e5f64ce8 100644 --- a/components/com_banners/src/Service/Router.php +++ b/components/com_banners/src/Service/Router.php @@ -46,10 +46,8 @@ public function build(&$query) unset($query['id']); } - $total = \count($segments); - - for ($i = 0; $i < $total; $i++) { - $segments[$i] = str_replace(':', '-', $segments[$i]); + foreach ($segments as &$segment) { + $segment = str_replace(':', '-', $segment); } return $segments; @@ -66,12 +64,12 @@ public function build(&$query) */ public function parse(&$segments) { - $total = \count($segments); $vars = []; - for ($i = 0; $i < $total; $i++) { - $segments[$i] = preg_replace('/-/', ':', $segments[$i], 1); + foreach ($segments as &$segment) { + $segment = preg_replace('/-/', ':', $segment, 1); } + unset($segment); // View is always the first element of the array $count = \count($segments); diff --git a/components/com_contact/src/Model/FeaturedModel.php b/components/com_contact/src/Model/FeaturedModel.php index 990340740df2c..7c2e7b6aa81e3 100644 --- a/components/com_contact/src/Model/FeaturedModel.php +++ b/components/com_contact/src/Model/FeaturedModel.php @@ -64,9 +64,7 @@ public function getItems() $items = parent::getItems(); // Convert the params field into an object, saving original in _params - for ($i = 0, $n = \count($items); $i < $n; $i++) { - $item = &$items[$i]; - + foreach ($items as $item) { if (!isset($this->_params)) { $item->params = new Registry($item->params); } diff --git a/components/com_contact/src/View/Featured/HtmlView.php b/components/com_contact/src/View/Featured/HtmlView.php index f7849b5de99c1..9a5832db13814 100644 --- a/components/com_contact/src/View/Featured/HtmlView.php +++ b/components/com_contact/src/View/Featured/HtmlView.php @@ -105,8 +105,7 @@ public function display($tpl = null) // Prepare the data. // Compute the contact slug. - for ($i = 0, $n = \count($items); $i < $n; $i++) { - $item = &$items[$i]; + foreach ($items as $item) { $item->slug = $item->alias ? ($item->id . ':' . $item->alias) : $item->id; $temp = $item->params; $item->params = clone $params; diff --git a/components/com_content/src/Model/ArticlesModel.php b/components/com_content/src/Model/ArticlesModel.php index 24dcc4a701b1b..206cb5ec02194 100644 --- a/components/com_content/src/Model/ArticlesModel.php +++ b/components/com_content/src/Model/ArticlesModel.php @@ -490,7 +490,10 @@ protected function getListQuery() } // Filter by start and end dates. - if ((!$user->authorise('core.edit.state', 'com_content')) && (!$user->authorise('core.edit', 'com_content'))) { + if ( + !(is_numeric($condition) && $condition == ContentComponent::CONDITION_UNPUBLISHED) + && !(\is_array($condition) && \in_array(ContentComponent::CONDITION_UNPUBLISHED, $condition)) + ) { $query->where( [ '(' . $db->quoteName('a.publish_up') . ' IS NULL OR ' . $db->quoteName('a.publish_up') . ' <= :publishUp)', diff --git a/components/com_content/src/View/Archive/HtmlView.php b/components/com_content/src/View/Archive/HtmlView.php index 343318bd64991..5d06925652d52 100644 --- a/components/com_content/src/View/Archive/HtmlView.php +++ b/components/com_content/src/View/Archive/HtmlView.php @@ -197,8 +197,8 @@ public function display($tpl = null) $years = []; $years[] = HTMLHelper::_('select.option', null, Text::_('JYEAR')); - for ($i = 0, $iMax = \count($this->years); $i < $iMax; $i++) { - $years[] = HTMLHelper::_('select.option', $this->years[$i], $this->years[$i]); + foreach ($this->years as $year) { + $years[] = HTMLHelper::_('select.option', $year, $year); } $form->yearField = HTMLHelper::_( diff --git a/components/com_finder/src/Model/SearchModel.php b/components/com_finder/src/Model/SearchModel.php index c61252fce42a3..30da21a70b307 100644 --- a/components/com_finder/src/Model/SearchModel.php +++ b/components/com_finder/src/Model/SearchModel.php @@ -198,8 +198,8 @@ protected function getListQuery() ->where('t.node_id IN (' . implode(',', array_unique($taxonomies)) . ')'); // Iterate through each taxonomy group. - for ($i = 0, $c = \count($groups); $i < $c; $i++) { - $query->having('SUM(CASE WHEN t.node_id IN (' . implode(',', $groups[$i]) . ') THEN 1 ELSE 0 END) > 0'); + foreach ($groups as $group) { + $query->having('SUM(CASE WHEN t.node_id IN (' . implode(',', $group) . ') THEN 1 ELSE 0 END) > 0'); } } diff --git a/components/com_tags/src/Model/TagModel.php b/components/com_tags/src/Model/TagModel.php index 8d649a159bdc1..37d501ebc086e 100644 --- a/components/com_tags/src/Model/TagModel.php +++ b/components/com_tags/src/Model/TagModel.php @@ -303,10 +303,6 @@ public function getItem($pk = null) return false; } } - - if (\count($this->item) != \count($idsArray)) { - throw new \Exception(Text::_('COM_TAGS_TAG_NOT_FOUND'), 404); - } } return $this->item; diff --git a/components/com_tags/src/Service/Router.php b/components/com_tags/src/Service/Router.php index 6d9fe00b95791..e96b23363f43e 100644 --- a/components/com_tags/src/Service/Router.php +++ b/components/com_tags/src/Service/Router.php @@ -53,8 +53,8 @@ class Router extends RouterBase * System - SEF Plugin parameters * * @var Registry - * @since __DEPLOY_VERSION__ - * @deprecated __DEPLOY_VERSION__ will be removed in 6.0 + * @since 5.2.0 + * @deprecated 5.2.0 will be removed in 6.0 * without replacement */ private $sefparams; diff --git a/components/com_users/src/Model/ProfileModel.php b/components/com_users/src/Model/ProfileModel.php index 3abfa00c247ce..99831c892194a 100644 --- a/components/com_users/src/Model/ProfileModel.php +++ b/components/com_users/src/Model/ProfileModel.php @@ -321,7 +321,7 @@ public function getTwofactorform($userId = null) public function getOtpConfig($userId = null) { @trigger_error( - sprintf( + \sprintf( '%s() is deprecated. Use \Joomla\Component\Users\Administrator\Helper\Mfa::getUserMfaRecords() instead.', __METHOD__ ), diff --git a/components/com_users/src/Rule/LoginUniqueFieldRule.php b/components/com_users/src/Rule/LoginUniqueFieldRule.php index 6a8227c146d27..b4660226c5733 100644 --- a/components/com_users/src/Rule/LoginUniqueFieldRule.php +++ b/components/com_users/src/Rule/LoginUniqueFieldRule.php @@ -49,11 +49,11 @@ public function test(\SimpleXMLElement $element, $value, $group = null, ?Registr $loginRedirectMenuitem = $input['params']->login_redirect_menuitem; if ($form === null) { - throw new \InvalidArgumentException(sprintf('The value for $form must not be null in %s', \get_class($this))); + throw new \InvalidArgumentException(\sprintf('The value for $form must not be null in %s', \get_class($this))); } if ($input === null) { - throw new \InvalidArgumentException(sprintf('The value for $input must not be null in %s', \get_class($this))); + throw new \InvalidArgumentException(\sprintf('The value for $input must not be null in %s', \get_class($this))); } // Test the input values for login. diff --git a/components/com_users/src/Rule/LogoutUniqueFieldRule.php b/components/com_users/src/Rule/LogoutUniqueFieldRule.php index 299de562a4dea..d079e1816ea6b 100644 --- a/components/com_users/src/Rule/LogoutUniqueFieldRule.php +++ b/components/com_users/src/Rule/LogoutUniqueFieldRule.php @@ -49,11 +49,11 @@ public function test(\SimpleXMLElement $element, $value, $group = null, ?Registr $logoutRedirectMenuitem = $input['params']->logout_redirect_menuitem; if ($form === null) { - throw new \InvalidArgumentException(sprintf('The value for $form must not be null in %s', \get_class($this))); + throw new \InvalidArgumentException(\sprintf('The value for $form must not be null in %s', \get_class($this))); } if ($input === null) { - throw new \InvalidArgumentException(sprintf('The value for $input must not be null in %s', \get_class($this))); + throw new \InvalidArgumentException(\sprintf('The value for $input must not be null in %s', \get_class($this))); } // Test the input values for logout. diff --git a/composer.json b/composer.json index e38c755bd4650..c09c655670c5c 100644 --- a/composer.json +++ b/composer.json @@ -60,7 +60,7 @@ "joomla/di": "^3.0.1", "joomla/event": "^3.0.1", "joomla/filter": "^3.0.2", - "joomla/filesystem": "^3.0.1", + "joomla/filesystem": "^3.0.2", "joomla/http": "^3.0.1", "joomla/input": "~3.0", "joomla/language": "~3.0", @@ -90,7 +90,7 @@ "symfony/yaml": "^6.4.11", "typo3/phar-stream-wrapper": "^3.1.7", "wamania/php-stemmer": "^3.0.1", - "maximebf/debugbar": "^1.22.3", + "maximebf/debugbar": "^1.23.0", "tobscure/json-api": "dev-joomla-backports", "willdurand/negotiation": "^3.1.0", "ext-json": "*", @@ -101,22 +101,22 @@ "ext-dom": "*", "composer/ca-bundle": "^1.5.1", "dragonmantank/cron-expression": "^3.3.3", - "enshrined/svg-sanitize": "^0.15.4", + "enshrined/svg-sanitize": "^0.20.0", "lcobucci/jwt": "^4.3.0", "web-token/jwt-library": "^3.4.6", - "phpseclib/bcmath_compat": "^2.0.2", + "phpseclib/bcmath_compat": "^2.0.3", "jfcherng/php-diff": "^6.16.2", "voku/portable-utf8": "^6.0.13", "php-tuf/php-tuf": "^1.0.1" }, "require-dev": { "phpunit/phpunit": "^9.6.20", - "friendsofphp/php-cs-fixer": "^3.59.3", + "friendsofphp/php-cs-fixer": "^3.64.0", "squizlabs/php_codesniffer": "^3.10.2", "dealerdirect/phpcodesniffer-composer-installer": "^0.7.2", "joomla/mediawiki": "^3.0", "joomla/test": "~3.0", - "phpstan/phpstan": "^1.12.0", + "phpstan/phpstan": "^1.12.3", "phpstan/phpstan-deprecation-rules": "^1.2.0" }, "replace": { diff --git a/composer.lock b/composer.lock index 0a214ff602079..7abbbcadb10b2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ba4c2e20195d36f49dcbc2f283e824be", + "content-hash": "25ab9d74d7e71bd3effdc33143421b50", "packages": [ { "name": "algo26-matthias/idna-convert", @@ -424,22 +424,22 @@ }, { "name": "enshrined/svg-sanitize", - "version": "0.15.4", + "version": "0.20.0", "source": { "type": "git", "url": "https://github.com/darylldoyle/svg-sanitizer.git", - "reference": "e50b83a2f1f296ca61394fe88fbfe3e896a84cf4" + "reference": "068d9fcf912c88a0471d101d95a2caa87c50aee7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/darylldoyle/svg-sanitizer/zipball/e50b83a2f1f296ca61394fe88fbfe3e896a84cf4", - "reference": "e50b83a2f1f296ca61394fe88fbfe3e896a84cf4", + "url": "https://api.github.com/repos/darylldoyle/svg-sanitizer/zipball/068d9fcf912c88a0471d101d95a2caa87c50aee7", + "reference": "068d9fcf912c88a0471d101d95a2caa87c50aee7", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", - "php": "^7.0 || ^8.0" + "php": "^7.1 || ^8.0" }, "require-dev": { "phpunit/phpunit": "^6.5 || ^8.5" @@ -463,9 +463,9 @@ "description": "An SVG sanitizer for PHP", "support": { "issues": "https://github.com/darylldoyle/svg-sanitizer/issues", - "source": "https://github.com/darylldoyle/svg-sanitizer/tree/0.15.4" + "source": "https://github.com/darylldoyle/svg-sanitizer/tree/0.20.0" }, - "time": "2022-02-21T09:13:59+00:00" + "time": "2024-09-05T10:18:12+00:00" }, { "name": "fig/link-util", @@ -1717,16 +1717,16 @@ }, { "name": "joomla/filesystem", - "version": "3.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/joomla-framework/filesystem.git", - "reference": "c636a134c95f9c7003cdf8f8d18d416a83688f2a" + "reference": "c69358f6500b8d931bd6e4e3042aa365dcace155" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-framework/filesystem/zipball/c636a134c95f9c7003cdf8f8d18d416a83688f2a", - "reference": "c636a134c95f9c7003cdf8f8d18d416a83688f2a", + "url": "https://api.github.com/repos/joomla-framework/filesystem/zipball/c69358f6500b8d931bd6e4e3042aa365dcace155", + "reference": "c69358f6500b8d931bd6e4e3042aa365dcace155", "shasum": "" }, "require": { @@ -1765,7 +1765,7 @@ ], "support": { "issues": "https://github.com/joomla-framework/filesystem/issues", - "source": "https://github.com/joomla-framework/filesystem/tree/3.0.1" + "source": "https://github.com/joomla-framework/filesystem/tree/3.0.2" }, "funding": [ { @@ -1777,7 +1777,7 @@ "type": "github" } ], - "time": "2024-08-16T09:41:56+00:00" + "time": "2024-09-12T11:44:35+00:00" }, { "name": "joomla/filter", @@ -2864,16 +2864,16 @@ }, { "name": "maximebf/debugbar", - "version": "v1.22.3", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/maximebf/php-debugbar.git", - "reference": "7aa9a27a0b1158ed5ad4e7175e8d3aee9a818b96" + "reference": "0143b7c17daad5336ebd406c279333c84723cc41" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/7aa9a27a0b1158ed5ad4e7175e8d3aee9a818b96", - "reference": "7aa9a27a0b1158ed5ad4e7175e8d3aee9a818b96", + "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/0143b7c17daad5336ebd406c279333c84723cc41", + "reference": "0143b7c17daad5336ebd406c279333c84723cc41", "shasum": "" }, "require": { @@ -2895,7 +2895,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.22-dev" + "dev-master": "1.23-dev" } }, "autoload": { @@ -2926,9 +2926,9 @@ ], "support": { "issues": "https://github.com/maximebf/php-debugbar/issues", - "source": "https://github.com/maximebf/php-debugbar/tree/v1.22.3" + "source": "https://github.com/maximebf/php-debugbar/tree/v1.23.0" }, - "time": "2024-04-03T19:39:26+00:00" + "time": "2024-09-10T17:28:47+00:00" }, { "name": "paragonie/constant_time_encoding", @@ -3240,16 +3240,16 @@ }, { "name": "phpseclib/bcmath_compat", - "version": "2.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/phpseclib/bcmath_compat.git", - "reference": "29bbf07a7039ff65ce7daa44502ba34baf1512ec" + "reference": "ae8f87ea0c96b2ef08ecf0d291d45372d0f7bc5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/bcmath_compat/zipball/29bbf07a7039ff65ce7daa44502ba34baf1512ec", - "reference": "29bbf07a7039ff65ce7daa44502ba34baf1512ec", + "url": "https://api.github.com/repos/phpseclib/bcmath_compat/zipball/ae8f87ea0c96b2ef08ecf0d291d45372d0f7bc5a", + "reference": "ae8f87ea0c96b2ef08ecf0d291d45372d0f7bc5a", "shasum": "" }, "require": { @@ -3298,7 +3298,7 @@ "issues": "https://github.com/phpseclib/bcmath_compat/issues", "source": "https://github.com/phpseclib/bcmath_compat" }, - "time": "2024-02-21T10:30:36+00:00" + "time": "2024-06-06T14:17:54+00:00" }, { "name": "phpseclib/phpseclib", @@ -7203,16 +7203,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.59.3", + "version": "v3.64.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "30ba9ecc2b0e5205e578fe29973c15653d9bfd29" + "reference": "58dd9c931c785a79739310aef5178928305ffa67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/30ba9ecc2b0e5205e578fe29973c15653d9bfd29", - "reference": "30ba9ecc2b0e5205e578fe29973c15653d9bfd29", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/58dd9c931c785a79739310aef5178928305ffa67", + "reference": "58dd9c931c785a79739310aef5178928305ffa67", "shasum": "" }, "require": { @@ -7294,7 +7294,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.59.3" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.64.0" }, "funding": [ { @@ -7302,7 +7302,7 @@ "type": "github" } ], - "time": "2024-06-16T14:17:03+00:00" + "time": "2024-08-30T23:09:38+00:00" }, { "name": "joomla/mediawiki", @@ -7682,16 +7682,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.0", + "version": "1.12.3", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "384af967d35b2162f69526c7276acadce534d0e1" + "reference": "0fcbf194ab63d8159bb70d9aa3e1350051632009" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/384af967d35b2162f69526c7276acadce534d0e1", - "reference": "384af967d35b2162f69526c7276acadce534d0e1", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0fcbf194ab63d8159bb70d9aa3e1350051632009", + "reference": "0fcbf194ab63d8159bb70d9aa3e1350051632009", "shasum": "" }, "require": { @@ -7736,7 +7736,7 @@ "type": "github" } ], - "time": "2024-08-27T09:18:05+00:00" + "time": "2024-09-09T08:10:35+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", diff --git a/installation/language/af-ZA/langmetadata.xml b/installation/language/af-ZA/langmetadata.xml index 5127ff88b4705..700fa863b59d3 100644 --- a/installation/language/af-ZA/langmetadata.xml +++ b/installation/language/af-ZA/langmetadata.xml @@ -1,8 +1,8 @@ Afrikaans (Suid-Afrika) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Afrikaans Translation Team (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/ar-AA/langmetadata.xml b/installation/language/ar-AA/langmetadata.xml index 2ae20b060bcb0..e2eb32f9cfd8a 100644 --- a/installation/language/ar-AA/langmetadata.xml +++ b/installation/language/ar-AA/langmetadata.xml @@ -1,8 +1,8 @@ Arabic (اللغة العربية) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Dr. Ashraf Damra (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/be-BY/langmetadata.xml b/installation/language/be-BY/langmetadata.xml index 56465ce3b9c3e..be80c74910914 100644 --- a/installation/language/be-BY/langmetadata.xml +++ b/installation/language/be-BY/langmetadata.xml @@ -1,8 +1,8 @@ Belarusian (Belarus) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Joomla Belarus Community (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/bg-BG/langmetadata.xml b/installation/language/bg-BG/langmetadata.xml index 7aca9fc18ad0f..0c7278f99f60c 100644 --- a/installation/language/bg-BG/langmetadata.xml +++ b/installation/language/bg-BG/langmetadata.xml @@ -1,8 +1,8 @@ Bulgarian (bg-BG) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Joomla! Bulgaria (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/ca-ES/langmetadata.xml b/installation/language/ca-ES/langmetadata.xml index 002690a77fe03..0aeb98b01cb45 100644 --- a/installation/language/ca-ES/langmetadata.xml +++ b/installation/language/ca-ES/langmetadata.xml @@ -1,8 +1,8 @@ Catalan (ca-ES) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Catalan [ca-ES] Translation Team (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/cs-CZ/langmetadata.xml b/installation/language/cs-CZ/langmetadata.xml index 3797a2dbe0622..b4d2685b98de8 100644 --- a/installation/language/cs-CZ/langmetadata.xml +++ b/installation/language/cs-CZ/langmetadata.xml @@ -1,8 +1,8 @@ Czech (Čeština) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Czech Translation Team (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/cy-GB/langmetadata.xml b/installation/language/cy-GB/langmetadata.xml index a4c0fd44baa48..9b772a9d87f95 100644 --- a/installation/language/cy-GB/langmetadata.xml +++ b/installation/language/cy-GB/langmetadata.xml @@ -1,8 +1,8 @@ Welsh (United Kingdom) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Joomla! Project - Welsh Translation Team (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/da-DK/langmetadata.xml b/installation/language/da-DK/langmetadata.xml index a184b8c57ccd2..0b06e064a1ef0 100644 --- a/installation/language/da-DK/langmetadata.xml +++ b/installation/language/da-DK/langmetadata.xml @@ -1,8 +1,8 @@ Danish (Danmark) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Danish Translation Team (Transl.: Ronny Buelund) (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/de-AT/joomla.ini b/installation/language/de-AT/joomla.ini index 3f401c0edef00..f227211c3ddca 100644 --- a/installation/language/de-AT/joomla.ini +++ b/installation/language/de-AT/joomla.ini @@ -137,7 +137,7 @@ INSTL_LANGUAGES_COLUMN_HEADER_LANGUAGE="Sprache" INSTL_LANGUAGES_COLUMN_HEADER_LANGUAGE_SELECT="Sprache wählen" INSTL_LANGUAGES_COLUMN_HEADER_LANGUAGE_TAG="Sprach-Tag" INSTL_LANGUAGES_COLUMN_HEADER_VERSION="Version" -INSTL_LANGUAGES_DESC="Die Oberfläche von Joomla! ist in vielen Sprachen verfügbar. Um eine Sprache zu installieren, muss nur die Checkbox vor dem gewünschten Eintrag durch einen Klick markiert werden und anschließend wird die Sprache durch einen Klick auf „Ausgewählte Sprachen installieren“ installiert.

Hinweis:
Diese Operation braucht ca. 10 Sekunden für den Download und die Installation der Sprache.
Daher sollten nicht mehr als 3 Sprachen gleichzeitig ausgewählt werden, um Zeitüberschreitungen zu verhindern." +INSTL_LANGUAGES_DESC="Die Oberfläche von Joomla! ist in vielen Sprachen verfügbar. Um eine Sprache zu installieren, muss nur die Checkbox vor dem gewünschten Eintrag durch einen Klick markiert werden und anschließend wird die Sprache durch einen Klick auf „Ausgewählte Sprachen installieren“ installiert.

Hinweis:
Diese Operation braucht ca. 10 Sekunden für den Download und die Installation der Sprache.
Daher sollten nicht mehr als 3 Sprachen gleichzeitig ausgewählt werden, um Zeitüberschreitungen zu verhindern." INSTL_LANGUAGES_MESSAGE_PLEASE_WAIT="Diese Operation kann bis zu 10 Sekunden pro Sprache in Anspruch nehmen.
Bitte warten, bis die Sprachen heruntergeladen und installiert sind ..." INSTL_LANGUAGES_NO_LANGUAGE_SELECTED="Es wurden keine Sprachen zur Installation ausgewählt. Wenn weitere Sprachen installiert werden sollen, auf „Zurück“ klicken und die gewünschten Sprachen aus der Liste auswählen." INSTL_LANGUAGES_SELECTED="Ausgewählte Sprachen installieren" diff --git a/installation/language/de-AT/langmetadata.xml b/installation/language/de-AT/langmetadata.xml index ecc06ac11159e..7667542d51fa6 100644 --- a/installation/language/de-AT/langmetadata.xml +++ b/installation/language/de-AT/langmetadata.xml @@ -1,8 +1,8 @@ German (Austria) - 5.1.2 - 2024-07 + 5.1.4 + 2024-08 J!German (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/de-CH/joomla.ini b/installation/language/de-CH/joomla.ini index a70b959695f22..76401bbb1b132 100644 --- a/installation/language/de-CH/joomla.ini +++ b/installation/language/de-CH/joomla.ini @@ -137,7 +137,7 @@ INSTL_LANGUAGES_COLUMN_HEADER_LANGUAGE="Sprache" INSTL_LANGUAGES_COLUMN_HEADER_LANGUAGE_SELECT="Sprache wählen" INSTL_LANGUAGES_COLUMN_HEADER_LANGUAGE_TAG="Sprach-Tag" INSTL_LANGUAGES_COLUMN_HEADER_VERSION="Version" -INSTL_LANGUAGES_DESC="Die Oberfläche von Joomla! ist in vielen Sprachen verfügbar. Um eine Sprache zu installieren, muss nur die Checkbox vor dem gewünschten Eintrag durch einen Klick markiert werden und anschliessend wird die Sprache durch einen Klick auf „Ausgewählte Sprachen installieren“ installiert.

Hinweis:
Diese Operation braucht ca. 10 Sekunden für den Download und die Installation der Sprache.
Daher sollten nicht mehr als 3 Sprachen gleichzeitig ausgewählt werden, um Zeitüberschreitungen zu verhindern." +INSTL_LANGUAGES_DESC="Die Oberfläche von Joomla! ist in vielen Sprachen verfügbar. Um eine Sprache zu installieren, muss nur die Checkbox vor dem gewünschten Eintrag durch einen Klick markiert werden und anschliessend wird die Sprache durch einen Klick auf „Ausgewählte Sprachen installieren“ installiert.

Hinweis:
Diese Operation braucht ca. 10 Sekunden für den Download und die Installation der Sprache.
Daher sollten nicht mehr als 3 Sprachen gleichzeitig ausgewählt werden, um Zeitüberschreitungen zu verhindern." INSTL_LANGUAGES_MESSAGE_PLEASE_WAIT="Diese Operation kann bis zu 10 Sekunden pro Sprache in Anspruch nehmen.
Bitte warten, bis die Sprachen heruntergeladen und installiert sind ..." INSTL_LANGUAGES_NO_LANGUAGE_SELECTED="Es wurden keine Sprachen zur Installation ausgewählt. Wenn weitere Sprachen installiert werden sollen, auf „Zurück“ klicken und die gewünschten Sprachen aus der Liste auswählen." INSTL_LANGUAGES_SELECTED="Ausgewählte Sprachen installieren" diff --git a/installation/language/de-CH/langmetadata.xml b/installation/language/de-CH/langmetadata.xml index a4887b3a7d545..e6fb8343718f3 100644 --- a/installation/language/de-CH/langmetadata.xml +++ b/installation/language/de-CH/langmetadata.xml @@ -1,8 +1,8 @@ German (Switzerland) - 5.1.2 - 2024-07 + 5.1.4 + 2024-08 J!German (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/de-DE/joomla.ini b/installation/language/de-DE/joomla.ini index 55f8751fb8e69..5c3d380ed6c7c 100644 --- a/installation/language/de-DE/joomla.ini +++ b/installation/language/de-DE/joomla.ini @@ -137,7 +137,7 @@ INSTL_LANGUAGES_COLUMN_HEADER_LANGUAGE="Sprache" INSTL_LANGUAGES_COLUMN_HEADER_LANGUAGE_SELECT="Sprache wählen" INSTL_LANGUAGES_COLUMN_HEADER_LANGUAGE_TAG="Sprach-Tag" INSTL_LANGUAGES_COLUMN_HEADER_VERSION="Version" -INSTL_LANGUAGES_DESC="Die Oberfläche von Joomla! ist in vielen Sprachen verfügbar. Um eine Sprache zu installieren, muss nur die Checkbox vor dem gewünschten Eintrag durch einen Klick markiert werden und anschließend wird die Sprache durch einen Klick auf „Ausgewählte Sprachen installieren“ installiert.

Hinweis:
Diese Operation braucht ca. 10 Sekunden für den Download und die Installation der Sprache.
Daher sollten nicht mehr als 3 Sprachen gleichzeitig ausgewählt werden, um Zeitüberschreitungen zu verhindern." +INSTL_LANGUAGES_DESC="Die Oberfläche von Joomla! ist in vielen Sprachen verfügbar. Um eine Sprache zu installieren, muss nur die Checkbox vor dem gewünschten Eintrag durch einen Klick markiert werden und anschließend wird die Sprache durch einen Klick auf „Ausgewählte Sprachen installieren“ installiert.

Hinweis:
Diese Operation braucht ca. 10 Sekunden für den Download und die Installation der Sprache.
Daher sollten nicht mehr als 3 Sprachen gleichzeitig ausgewählt werden, um Zeitüberschreitungen zu verhindern." INSTL_LANGUAGES_MESSAGE_PLEASE_WAIT="Diese Operation kann bis zu 10 Sekunden pro Sprache in Anspruch nehmen.
Bitte warten, bis die Sprachen heruntergeladen und installiert sind ..." INSTL_LANGUAGES_NO_LANGUAGE_SELECTED="Es wurden keine Sprachen zur Installation ausgewählt. Wenn weitere Sprachen installiert werden sollen, auf „Zurück“ klicken und die gewünschten Sprachen aus der Liste auswählen." INSTL_LANGUAGES_SELECTED="Ausgewählte Sprachen installieren" diff --git a/installation/language/de-DE/langmetadata.xml b/installation/language/de-DE/langmetadata.xml index d9b2062e34dab..22fcff6014a3f 100644 --- a/installation/language/de-DE/langmetadata.xml +++ b/installation/language/de-DE/langmetadata.xml @@ -1,8 +1,8 @@ German (Germany) - 5.1.2 - 2024-07 + 5.1.4 + 2024-08 J!German (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/de-LI/joomla.ini b/installation/language/de-LI/joomla.ini index 63cd4004955a7..6ce485e6c2e00 100644 --- a/installation/language/de-LI/joomla.ini +++ b/installation/language/de-LI/joomla.ini @@ -137,7 +137,7 @@ INSTL_LANGUAGES_COLUMN_HEADER_LANGUAGE="Sprache" INSTL_LANGUAGES_COLUMN_HEADER_LANGUAGE_SELECT="Sprache wählen" INSTL_LANGUAGES_COLUMN_HEADER_LANGUAGE_TAG="Sprach-Tag" INSTL_LANGUAGES_COLUMN_HEADER_VERSION="Version" -INSTL_LANGUAGES_DESC="Die Oberfläche von Joomla! ist in vielen Sprachen verfügbar. Um eine Sprache zu installieren, muss nur die Checkbox vor dem gewünschten Eintrag durch einen Klick markiert werden und anschliessend wird die Sprache durch einen Klick auf „Ausgewählte Sprachen installieren“ installiert.

Hinweis:
Diese Operation braucht ca. 10 Sekunden für den Download und die Installation der Sprache.
Daher sollten nicht mehr als 3 Sprachen gleichzeitig ausgewählt werden, um Zeitüberschreitungen zu verhindern." +INSTL_LANGUAGES_DESC="Die Oberfläche von Joomla! ist in vielen Sprachen verfügbar. Um eine Sprache zu installieren, muss nur die Checkbox vor dem gewünschten Eintrag durch einen Klick markiert werden und anschliessend wird die Sprache durch einen Klick auf „Ausgewählte Sprachen installieren“ installiert.

Hinweis:
Diese Operation braucht ca. 10 Sekunden für den Download und die Installation der Sprache.
Daher sollten nicht mehr als 3 Sprachen gleichzeitig ausgewählt werden, um Zeitüberschreitungen zu verhindern." INSTL_LANGUAGES_MESSAGE_PLEASE_WAIT="Diese Operation kann bis zu 10 Sekunden pro Sprache in Anspruch nehmen.
Bitte warten, bis die Sprachen heruntergeladen und installiert sind ..." INSTL_LANGUAGES_NO_LANGUAGE_SELECTED="Es wurden keine Sprachen zur Installation ausgewählt. Wenn weitere Sprachen installiert werden sollen, auf „Zurück“ klicken und die gewünschten Sprachen aus der Liste auswählen." INSTL_LANGUAGES_SELECTED="Ausgewählte Sprachen installieren" diff --git a/installation/language/de-LI/langmetadata.xml b/installation/language/de-LI/langmetadata.xml index db2eaf22dab6a..ada6a4be6af88 100644 --- a/installation/language/de-LI/langmetadata.xml +++ b/installation/language/de-LI/langmetadata.xml @@ -1,8 +1,8 @@ German (Liechtenstein) - 5.1.2 - 2024-07 + 5.1.4 + 2024-08 J!German (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/de-LU/joomla.ini b/installation/language/de-LU/joomla.ini index d076c4b5946dc..d06ba38f5db68 100644 --- a/installation/language/de-LU/joomla.ini +++ b/installation/language/de-LU/joomla.ini @@ -137,7 +137,7 @@ INSTL_LANGUAGES_COLUMN_HEADER_LANGUAGE="Sprache" INSTL_LANGUAGES_COLUMN_HEADER_LANGUAGE_SELECT="Sprache wählen" INSTL_LANGUAGES_COLUMN_HEADER_LANGUAGE_TAG="Sprach-Tag" INSTL_LANGUAGES_COLUMN_HEADER_VERSION="Version" -INSTL_LANGUAGES_DESC="Die Oberfläche von Joomla! ist in vielen Sprachen verfügbar. Um eine Sprache zu installieren, muss nur die Checkbox vor dem gewünschten Eintrag durch einen Klick markiert werden und anschließend wird die Sprache durch einen Klick auf „Ausgewählte Sprachen installieren“ installiert.

Hinweis:
Diese Operation braucht ca. 10 Sekunden für den Download und die Installation der Sprache.
Daher sollten nicht mehr als 3 Sprachen gleichzeitig ausgewählt werden, um Zeitüberschreitungen zu verhindern." +INSTL_LANGUAGES_DESC="Die Oberfläche von Joomla! ist in vielen Sprachen verfügbar. Um eine Sprache zu installieren, muss nur die Checkbox vor dem gewünschten Eintrag durch einen Klick markiert werden und anschließend wird die Sprache durch einen Klick auf „Ausgewählte Sprachen installieren“ installiert.

Hinweis:
Diese Operation braucht ca. 10 Sekunden für den Download und die Installation der Sprache.
Daher sollten nicht mehr als 3 Sprachen gleichzeitig ausgewählt werden, um Zeitüberschreitungen zu verhindern." INSTL_LANGUAGES_MESSAGE_PLEASE_WAIT="Diese Operation kann bis zu 10 Sekunden pro Sprache in Anspruch nehmen.
Bitte warten, bis die Sprachen heruntergeladen und installiert sind ..." INSTL_LANGUAGES_NO_LANGUAGE_SELECTED="Es wurden keine Sprachen zur Installation ausgewählt. Wenn weitere Sprachen installiert werden sollen, auf „Zurück“ klicken und die gewünschten Sprachen aus der Liste auswählen." INSTL_LANGUAGES_SELECTED="Ausgewählte Sprachen installieren" diff --git a/installation/language/de-LU/langmetadata.xml b/installation/language/de-LU/langmetadata.xml index c8cfaa75f6733..16f488ab5e17f 100644 --- a/installation/language/de-LU/langmetadata.xml +++ b/installation/language/de-LU/langmetadata.xml @@ -1,8 +1,8 @@ German (Luxembourg) - 5.1.2 - 2024-07 + 5.1.4 + 2024-08 J!German (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/el-GR/langmetadata.xml b/installation/language/el-GR/langmetadata.xml index 5e68ca6e7aec4..7a6d1ebf64c35 100644 --- a/installation/language/el-GR/langmetadata.xml +++ b/installation/language/el-GR/langmetadata.xml @@ -1,8 +1,8 @@ Greek (el-GR) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Ομάδα Μετάφρασης: joomla. gr (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/en-AU/langmetadata.xml b/installation/language/en-AU/langmetadata.xml index 4de668bb1238b..0e92d39b55eed 100644 --- a/installation/language/en-AU/langmetadata.xml +++ b/installation/language/en-AU/langmetadata.xml @@ -1,8 +1,8 @@ English (Australia) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Joomla! Project (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/en-CA/langmetadata.xml b/installation/language/en-CA/langmetadata.xml index 5d17cd73ba69e..565a0d77870fb 100644 --- a/installation/language/en-CA/langmetadata.xml +++ b/installation/language/en-CA/langmetadata.xml @@ -1,8 +1,8 @@ English (Canada) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Joomla! Project (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/en-NZ/langmetadata.xml b/installation/language/en-NZ/langmetadata.xml index cea856c006d9c..077496a9bcaa7 100644 --- a/installation/language/en-NZ/langmetadata.xml +++ b/installation/language/en-NZ/langmetadata.xml @@ -1,8 +1,8 @@ English (New Zealand) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Joomla! Project (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/en-US/langmetadata.xml b/installation/language/en-US/langmetadata.xml index a492839110d79..99230ff78ed15 100644 --- a/installation/language/en-US/langmetadata.xml +++ b/installation/language/en-US/langmetadata.xml @@ -1,8 +1,8 @@ English (United States) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Joomla! Project (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/es-ES/joomla.ini b/installation/language/es-ES/joomla.ini index 466802f4dea58..f7c46314117fd 100644 --- a/installation/language/es-ES/joomla.ini +++ b/installation/language/es-ES/joomla.ini @@ -29,7 +29,7 @@ INSTL_SELECT_INSTALL_LANG="Seleccione el idioma de instalación" INSTL_SELECT_LANGUAGE_TITLE="Seleccione el idioma" INSTL_SETUP_LOGIN_DATA="Configurar los datos de inicio de sesión" INSTL_WARNJAVASCRIPT="¡Advertencia! JavaScript debe estar habilitado para una correcta instalación de Joomla." -INSTL_WARNJSON="Para que se pueda instalar Joomla su instalacción de PHP necesita tener habilitado JSON." +INSTL_WARNJSON="¡Para que se pueda instalar Joomla su instalación de PHP necesita tener habilitado JSON!" ; Precheck view INSTL_DATABASE_SUPPORT="Soporte de la base de datos:" INSTL_JSON_SUPPORT_AVAILABLE="Soporte JSON" diff --git a/installation/language/es-ES/langmetadata.xml b/installation/language/es-ES/langmetadata.xml index 10c37a883f6e7..30d069f3c49d6 100644 --- a/installation/language/es-ES/langmetadata.xml +++ b/installation/language/es-ES/langmetadata.xml @@ -1,8 +1,8 @@ Spanish (es-ES) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Spanish [es-ES] Translation Team (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/et-EE/langmetadata.xml b/installation/language/et-EE/langmetadata.xml index 06359ddf64da6..e0446e0eecd14 100644 --- a/installation/language/et-EE/langmetadata.xml +++ b/installation/language/et-EE/langmetadata.xml @@ -1,8 +1,8 @@ Estonian - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Joomla! Project (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/eu-ES/langmetadata.xml b/installation/language/eu-ES/langmetadata.xml index 85fe06459d984..07965e287c867 100644 --- a/installation/language/eu-ES/langmetadata.xml +++ b/installation/language/eu-ES/langmetadata.xml @@ -1,8 +1,8 @@ Basque - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Joomla! Basque Translation Team (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/fa-AF/langmetadata.xml b/installation/language/fa-AF/langmetadata.xml index bdd1c043b6b05..daac81188f1d2 100644 --- a/installation/language/fa-AF/langmetadata.xml +++ b/installation/language/fa-AF/langmetadata.xml @@ -1,8 +1,8 @@ فارسی (دری) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 JoomlaPersian Translation Team (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/fa-IR/langmetadata.xml b/installation/language/fa-IR/langmetadata.xml index 7f72ec4a78221..58af566060cd2 100644 --- a/installation/language/fa-IR/langmetadata.xml +++ b/installation/language/fa-IR/langmetadata.xml @@ -1,8 +1,8 @@ Persian (fa-IR) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Persian Translation Team: joomlafarsi.com (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/fi-FI/joomla.ini b/installation/language/fi-FI/joomla.ini index 2c9364876639b..a39999f439656 100644 --- a/installation/language/fi-FI/joomla.ini +++ b/installation/language/fi-FI/joomla.ini @@ -87,7 +87,7 @@ INSTL_DATABASE_PREFIX_DUPLICATE_DESC="Jos käytät olemassa olevaa tietokantaa, INSTL_DATABASE_PREFIX_MSG="Tietokannan etuliite tulee alkaa kirjaimella, seuraavat voivat olla alfanumeerisia merkkejä päättyen alaviivaan" INSTL_DATABASE_RESPONSE_ERROR="Asennusprosessi epäonnistui." INSTL_DATABASE_TYPE_DESC="Valitse tietokannan tyyppi." -INSTL_DATABASE_USER_DESC="Syötä luomasi tai palveluntarjoajalta saamasi tietokannan salasana." +INSTL_DATABASE_USER_DESC="Syötä luomasi tai palveluntarjoajalta saamasi tietokannan käyttäjätunnus." INSTL_DATABASE_VALIDATION_ERROR="Tarkista tietokannan tunnukset, tietokannan tyyppi, tietokannan nimi tai isäntänimi. Jos MySQL 8 on asennettu niin lue tämä wiki saadaksesi lisätietoja." INSTL_CONNECT_DB="Määritä tietokantayhteys" diff --git a/installation/language/fi-FI/langmetadata.xml b/installation/language/fi-FI/langmetadata.xml index 2b54e0e4a1f3a..281fa70dc369c 100644 --- a/installation/language/fi-FI/langmetadata.xml +++ b/installation/language/fi-FI/langmetadata.xml @@ -1,8 +1,8 @@ Finnish (Finland) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Finnish translation team: Joomla.fi (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/fr-CA/langmetadata.xml b/installation/language/fr-CA/langmetadata.xml index 39e1bfccbbf29..08d3ee8ce50ab 100644 --- a/installation/language/fr-CA/langmetadata.xml +++ b/installation/language/fr-CA/langmetadata.xml @@ -1,8 +1,8 @@ French (Canada) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Joomla! Project - French translation team (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/fr-FR/langmetadata.xml b/installation/language/fr-FR/langmetadata.xml index 1146960a6474a..6b6f815525a3f 100644 --- a/installation/language/fr-FR/langmetadata.xml +++ b/installation/language/fr-FR/langmetadata.xml @@ -1,8 +1,8 @@ French (fr-FR) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Joomla! Project - French translation team (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/he-IL/langmetadata.xml b/installation/language/he-IL/langmetadata.xml index 5d69d9d5adf98..11bc063febb04 100644 --- a/installation/language/he-IL/langmetadata.xml +++ b/installation/language/he-IL/langmetadata.xml @@ -1,8 +1,8 @@ Hebrew (Israel) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 פרוייקט ג'ומלה (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/hr-HR/langmetadata.xml b/installation/language/hr-HR/langmetadata.xml index 6e901c75ca005..1e3896d535bc5 100644 --- a/installation/language/hr-HR/langmetadata.xml +++ b/installation/language/hr-HR/langmetadata.xml @@ -1,8 +1,8 @@ Croatian (Croatia) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Joomla! Hrvatska team (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/hu-HU/langmetadata.xml b/installation/language/hu-HU/langmetadata.xml index 22b82b25ca005..75c584775bcd3 100644 --- a/installation/language/hu-HU/langmetadata.xml +++ b/installation/language/hu-HU/langmetadata.xml @@ -1,8 +1,8 @@ Hungarian (Magyar) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Joomla! Magyarország (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/id-ID/langmetadata.xml b/installation/language/id-ID/langmetadata.xml index a9cdc0c5aedc6..f783b2d4dcb46 100644 --- a/installation/language/id-ID/langmetadata.xml +++ b/installation/language/id-ID/langmetadata.xml @@ -1,8 +1,8 @@ Bahasa Indonesia (id-ID) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Joomla! Indonesia (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/it-IT/langmetadata.xml b/installation/language/it-IT/langmetadata.xml index 5ec7a7cd5bad8..06b7f386216ef 100644 --- a/installation/language/it-IT/langmetadata.xml +++ b/installation/language/it-IT/langmetadata.xml @@ -1,8 +1,8 @@ Italiano (it-IT) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Joomla! Project (Italian Translation Team) (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/ja-JP/langmetadata.xml b/installation/language/ja-JP/langmetadata.xml index d48c68a79ce73..76cc6a36dec7e 100644 --- a/installation/language/ja-JP/langmetadata.xml +++ b/installation/language/ja-JP/langmetadata.xml @@ -1,8 +1,8 @@ Japanese (Japan) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Joomla!じゃぱん (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/ka-GE/langmetadata.xml b/installation/language/ka-GE/langmetadata.xml index 1b7e110aedd5b..8afc2e362193c 100644 --- a/installation/language/ka-GE/langmetadata.xml +++ b/installation/language/ka-GE/langmetadata.xml @@ -1,8 +1,8 @@ Georgian (Georgia) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Georgian Translation Team (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/kk-KZ/langmetadata.xml b/installation/language/kk-KZ/langmetadata.xml index 3211c62d633b2..425a8912fe8d7 100644 --- a/installation/language/kk-KZ/langmetadata.xml +++ b/installation/language/kk-KZ/langmetadata.xml @@ -1,8 +1,8 @@ Kazakh (Kazakhstan) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Sarvarov Akylkerey (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/ko-KR/langmetadata.xml b/installation/language/ko-KR/langmetadata.xml index 0bc090723bead..d999df7b6ce62 100644 --- a/installation/language/ko-KR/langmetadata.xml +++ b/installation/language/ko-KR/langmetadata.xml @@ -1,8 +1,8 @@ Korean (Republic of Korea) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Joomla! 프로젝트 (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/lt-LT/langmetadata.xml b/installation/language/lt-LT/langmetadata.xml index 6112043ba746d..b1edb376472d3 100644 --- a/installation/language/lt-LT/langmetadata.xml +++ b/installation/language/lt-LT/langmetadata.xml @@ -1,8 +1,8 @@ Lietuvių (lt-LT) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Oskaras Jankauskas (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/lv-LV/langmetadata.xml b/installation/language/lv-LV/langmetadata.xml index 3d4bdcfcc33f3..f1192ddcdf10e 100644 --- a/installation/language/lv-LV/langmetadata.xml +++ b/installation/language/lv-LV/langmetadata.xml @@ -1,8 +1,8 @@ Latvian (Latvia) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Joomla! Projekts (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/mk-MK/langmetadata.xml b/installation/language/mk-MK/langmetadata.xml index 1bf51193a97dd..13bc6d795f07a 100644 --- a/installation/language/mk-MK/langmetadata.xml +++ b/installation/language/mk-MK/langmetadata.xml @@ -1,8 +1,8 @@ Macedonian (mk-MK) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Joomla! Project (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/nl-BE/langmetadata.xml b/installation/language/nl-BE/langmetadata.xml index cfd312a555dec..78ac74fbda25a 100644 --- a/installation/language/nl-BE/langmetadata.xml +++ b/installation/language/nl-BE/langmetadata.xml @@ -1,8 +1,8 @@ Dutch (Belgium) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Dutch (BE) translation team (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/nl-NL/langmetadata.xml b/installation/language/nl-NL/langmetadata.xml index 584735ac70e65..93f5f0542ec09 100644 --- a/installation/language/nl-NL/langmetadata.xml +++ b/installation/language/nl-NL/langmetadata.xml @@ -1,8 +1,8 @@ Dutch (nl-NL) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Dutch Translation Team (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/pl-PL/langmetadata.xml b/installation/language/pl-PL/langmetadata.xml index 4fb2b78584ef0..64f423978a3db 100644 --- a/installation/language/pl-PL/langmetadata.xml +++ b/installation/language/pl-PL/langmetadata.xml @@ -1,8 +1,8 @@ Polski (PL) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Projekt Joomla! (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/pt-BR/langmetadata.xml b/installation/language/pt-BR/langmetadata.xml index a046b7563dac1..160558e49bc7e 100644 --- a/installation/language/pt-BR/langmetadata.xml +++ b/installation/language/pt-BR/langmetadata.xml @@ -1,8 +1,8 @@ Portuguese (Brazil) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Projeto Joomla! (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/pt-PT/langmetadata.xml b/installation/language/pt-PT/langmetadata.xml index 15560e9fc4eec..cf4b45deed5b6 100644 --- a/installation/language/pt-PT/langmetadata.xml +++ b/installation/language/pt-PT/langmetadata.xml @@ -1,8 +1,8 @@ Português (Portugal) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Comunidade JoomlaPortugal (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/ro-RO/langmetadata.xml b/installation/language/ro-RO/langmetadata.xml index 9ca62fa8d4723..6ac5207e4bf2e 100644 --- a/installation/language/ro-RO/langmetadata.xml +++ b/installation/language/ro-RO/langmetadata.xml @@ -1,8 +1,8 @@ Română (România) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Horia Negura - Quanta (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/sk-SK/langmetadata.xml b/installation/language/sk-SK/langmetadata.xml index f75077745f5b8..5bc7676afa199 100644 --- a/installation/language/sk-SK/langmetadata.xml +++ b/installation/language/sk-SK/langmetadata.xml @@ -1,8 +1,8 @@ Slovak (Slovakia) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Slovak translation team : Peter Michnica (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/sl-SI/langmetadata.xml b/installation/language/sl-SI/langmetadata.xml index a4f5243ff95fe..a260d6ea82347 100644 --- a/installation/language/sl-SI/langmetadata.xml +++ b/installation/language/sl-SI/langmetadata.xml @@ -1,8 +1,8 @@ Slovenščina (Slovenija) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Slovenska prevajalska ekipa (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/sr-YU/langmetadata.xml b/installation/language/sr-YU/langmetadata.xml index 92ad2459f2b93..3f41a0817ac0c 100644 --- a/installation/language/sr-YU/langmetadata.xml +++ b/installation/language/sr-YU/langmetadata.xml @@ -1,8 +1,8 @@ Srpski (Republika Srbija) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Goran Nešić - UIX Web Design & Saša Matić Bardak.RS (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/sv-SE/langmetadata.xml b/installation/language/sv-SE/langmetadata.xml index b10b3e6ed9fa4..ba219bcd33f08 100644 --- a/installation/language/sv-SE/langmetadata.xml +++ b/installation/language/sv-SE/langmetadata.xml @@ -1,8 +1,8 @@ Swedish (Sweden) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Swedish Translation Team - SvenskJoomla (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/ta-IN/langmetadata.xml b/installation/language/ta-IN/langmetadata.xml index b9684530179c5..44f9ae147c5c3 100644 --- a/installation/language/ta-IN/langmetadata.xml +++ b/installation/language/ta-IN/langmetadata.xml @@ -1,8 +1,8 @@ Tamil (India) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Ilagnayeru 'MIG' Manickam, Elango Samy Manim (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/th-TH/langmetadata.xml b/installation/language/th-TH/langmetadata.xml index e8ffde89e5108..4e114a5c2545e 100644 --- a/installation/language/th-TH/langmetadata.xml +++ b/installation/language/th-TH/langmetadata.xml @@ -1,8 +1,8 @@ Thai (ภาษาไทย) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Thai Translation Team (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/tr-TR/langmetadata.xml b/installation/language/tr-TR/langmetadata.xml index 8b0947285631a..875ea04673838 100644 --- a/installation/language/tr-TR/langmetadata.xml +++ b/installation/language/tr-TR/langmetadata.xml @@ -1,8 +1,8 @@ Turkish (Turkey) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Joomla! Türkiye (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/uk-UA/langmetadata.xml b/installation/language/uk-UA/langmetadata.xml index eca68e44c57c1..42ca4e25eef12 100644 --- a/installation/language/uk-UA/langmetadata.xml +++ b/installation/language/uk-UA/langmetadata.xml @@ -1,8 +1,8 @@ Ukrainian (uk-UA) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Denys Nosov (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/ur-PK/langmetadata.xml b/installation/language/ur-PK/langmetadata.xml index 23c9421ec079b..543c9a70e915c 100644 --- a/installation/language/ur-PK/langmetadata.xml +++ b/installation/language/ur-PK/langmetadata.xml @@ -1,8 +1,8 @@ Urdu (ur-PK) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Urdu Translation Team (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/vi-VN/langmetadata.xml b/installation/language/vi-VN/langmetadata.xml index 4e33b344cdab6..0388dc2a5ac26 100644 --- a/installation/language/vi-VN/langmetadata.xml +++ b/installation/language/vi-VN/langmetadata.xml @@ -1,8 +1,8 @@ Vietnamese (Vietnam) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Joomla! Project (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/zh-CN/langmetadata.xml b/installation/language/zh-CN/langmetadata.xml index 1c7c1e604f624..c1fb01d4c3a25 100644 --- a/installation/language/zh-CN/langmetadata.xml +++ b/installation/language/zh-CN/langmetadata.xml @@ -1,8 +1,8 @@ Chinese Simplified (China) - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 Joomla中文网 (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/installation/language/zh-TW/langmetadata.xml b/installation/language/zh-TW/langmetadata.xml index bf6f374c2828a..513e65c830273 100644 --- a/installation/language/zh-TW/langmetadata.xml +++ b/installation/language/zh-TW/langmetadata.xml @@ -1,8 +1,8 @@ 正體中文 - 5.1.4 - 2024-08 + 5.2.0 + 2024-09 正體中文 Translation Team (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/language/en-GB/lib_joomla.ini b/language/en-GB/lib_joomla.ini index 99afcc73211ff..55dba9313be48 100644 --- a/language/en-GB/lib_joomla.ini +++ b/language/en-GB/lib_joomla.ini @@ -146,6 +146,7 @@ JLIB_DATABASE_ERROR_MENU_CANNOT_UNSET_DEFAULT="The Language parameter for this m JLIB_DATABASE_ERROR_MENU_CANNOT_UNSET_DEFAULT_DEFAULT="At least one menu item has to be set as Default." JLIB_DATABASE_ERROR_MENU_DEFAULT_CHECKIN_USER_MISMATCH="The current home menu for this language is checked out." JLIB_DATABASE_ERROR_MENU_HOME_NOT_COMPONENT="The home menu item must be a component." +; The following string is deprecated and will be removed with 7.0 JLIB_DATABASE_ERROR_MENU_HOME_NOT_UNIQUE_IN_MENU="A menu should have only one Default home." JLIB_DATABASE_ERROR_MENU_ROOT_ALIAS_COMPONENT="A first level menu item alias can't be 'component'." JLIB_DATABASE_ERROR_MENU_ROOT_ALIAS_FOLDER="A first level menu item alias can't be '%s' because '%s' is a sub-folder of your Joomla installation folder." @@ -441,6 +442,10 @@ JLIB_HTML_FEATURED_PENDING_ITEM="Featured, but is Pending." JLIB_HTML_FEATURED_STARTED="Start: %s" JLIB_HTML_GOTO_PAGE="Go to page %s" JLIB_HTML_GOTO_POSITION="Go to %s page" +JLIB_HTML_GOTO_POSITION_END="Go to last page" +JLIB_HTML_GOTO_POSITION_NEXT="Go to next page" +JLIB_HTML_GOTO_POSITION_PREVIOUS="Go to previous page" +JLIB_HTML_GOTO_POSITION_START="Go to first page" JLIB_HTML_MOVE_DOWN="Move Down" JLIB_HTML_MOVE_UP="Move Up" JLIB_HTML_NO_PARAMETERS_FOR_THIS_ITEM="There are no parameters for this item." diff --git a/layouts/joomla/pagination/link.php b/layouts/joomla/pagination/link.php index 52a6f77e990f8..5f17aee9c8a30 100644 --- a/layouts/joomla/pagination/link.php +++ b/layouts/joomla/pagination/link.php @@ -21,26 +21,25 @@ // Check for "Start" item case Text::_('JLIB_HTML_START'): $icon = $app->getLanguage()->isRtl() ? 'icon-angle-double-right' : 'icon-angle-double-left'; - $aria = Text::sprintf('JLIB_HTML_GOTO_POSITION', strtolower($item->text)); + $aria = Text::_('JLIB_HTML_GOTO_POSITION_START'); break; // Check for "Prev" item case $item->text === Text::_('JPREV'): - $item->text = Text::_('JPREVIOUS'); $icon = $app->getLanguage()->isRtl() ? 'icon-angle-right' : 'icon-angle-left'; - $aria = Text::sprintf('JLIB_HTML_GOTO_POSITION', strtolower($item->text)); + $aria = Text::_('JLIB_HTML_GOTO_POSITION_PREVIOUS'); break; // Check for "Next" item case Text::_('JNEXT'): $icon = $app->getLanguage()->isRtl() ? 'icon-angle-left' : 'icon-angle-right'; - $aria = Text::sprintf('JLIB_HTML_GOTO_POSITION', strtolower($item->text)); + $aria = Text::_('JLIB_HTML_GOTO_POSITION_NEXT'); break; // Check for "End" item case Text::_('JLIB_HTML_END'): $icon = $app->getLanguage()->isRtl() ? 'icon-angle-double-left' : 'icon-angle-double-right'; - $aria = Text::sprintf('JLIB_HTML_GOTO_POSITION', strtolower($item->text)); + $aria = Text::_('JLIB_HTML_GOTO_POSITION_END'); break; default: diff --git a/libraries/src/Access/Access.php b/libraries/src/Access/Access.php index c7f64af3f4752..ccf48cf014065 100644 --- a/libraries/src/Access/Access.php +++ b/libraries/src/Access/Access.php @@ -679,10 +679,10 @@ protected static function getAssetId($assetKey) if (isset($preloadedAssetsByName[$assetKey])) { $loaded[$assetKey] = $preloadedAssetsByName[$assetKey]; } else { - // Else we have to do an extra db query to fetch it from the table fetch it from table. + // Else we have to do an extra db query to fetch it from the table. $table = new Asset(Factory::getDbo()); $table->load(['name' => $assetKey]); - $loaded[$assetKey] = $table->id; + $loaded[$assetKey] = $table->id ?? 0; } } } diff --git a/libraries/src/Application/CLI/ColorStyle.php b/libraries/src/Application/CLI/ColorStyle.php index 3017f61b75ca6..9bf56abb5cf07 100644 --- a/libraries/src/Application/CLI/ColorStyle.php +++ b/libraries/src/Application/CLI/ColorStyle.php @@ -108,7 +108,7 @@ public function __construct(string $fg = '', string $bg = '', array $options = [ if ($fg) { if (\array_key_exists($fg, static::$knownColors) == false) { throw new \InvalidArgumentException( - sprintf( + \sprintf( 'Invalid foreground color "%1$s" [%2$s]', $fg, implode(', ', $this->getKnownColors()) @@ -122,7 +122,7 @@ public function __construct(string $fg = '', string $bg = '', array $options = [ if ($bg) { if (\array_key_exists($bg, static::$knownColors) == false) { throw new \InvalidArgumentException( - sprintf( + \sprintf( 'Invalid background color "%1$s" [%2$s]', $bg, implode(', ', $this->getKnownColors()) @@ -136,7 +136,7 @@ public function __construct(string $fg = '', string $bg = '', array $options = [ foreach ($options as $option) { if (\array_key_exists($option, static::$knownOptions) == false) { throw new \InvalidArgumentException( - sprintf( + \sprintf( 'Invalid option "%1$s" [%2$s]', $option, implode(', ', $this->getKnownOptions()) diff --git a/libraries/src/Application/CMSApplication.php b/libraries/src/Application/CMSApplication.php index 11271b5be7e38..f9a69ec9ed455 100644 --- a/libraries/src/Application/CMSApplication.php +++ b/libraries/src/Application/CMSApplication.php @@ -445,7 +445,7 @@ public function getCfg($varname, $default = null) { try { Log::add( - sprintf('%s() is deprecated and will be removed in 6.0. Use Factory->getApplication()->get() instead.', __METHOD__), + \sprintf('%s() is deprecated and will be removed in 6.0. Use Factory->getApplication()->get() instead.', __METHOD__), Log::WARNING, 'deprecated' ); @@ -1217,7 +1217,7 @@ public function getFormToken($forceNew = false) /** @var Session $session */ $session = $this->getSession(); - return $session->getFormToken($forceNew); + return $session::getFormToken($forceNew); } /** @@ -1236,7 +1236,7 @@ public function checkToken($method = 'post') /** @var Session $session */ $session = $this->getSession(); - return $session->checkToken($method); + return $session::checkToken($method); } /** diff --git a/libraries/src/Application/CliApplication.php b/libraries/src/Application/CliApplication.php index 18f2dc9bda8cb..9acaae1fc84ab 100644 --- a/libraries/src/Application/CliApplication.php +++ b/libraries/src/Application/CliApplication.php @@ -178,7 +178,7 @@ public function __get($name) default: $trace = debug_backtrace(); trigger_error( - sprintf( + \sprintf( 'Undefined property via __get(): %1$s in %2$s on line %3$s', $name, $trace[0]['file'], @@ -235,7 +235,7 @@ public static function getInstance($name = null) // Only create the object if it doesn't exist. if (empty(static::$instance)) { if (!class_exists($name)) { - throw new \RuntimeException(sprintf('Unable to load application: %s', $name), 500); + throw new \RuntimeException(\sprintf('Unable to load application: %s', $name), 500); } static::$instance = new $name(); diff --git a/libraries/src/Application/ConsoleApplication.php b/libraries/src/Application/ConsoleApplication.php index a4f0e1f0e3bfd..5941c4225c993 100644 --- a/libraries/src/Application/ConsoleApplication.php +++ b/libraries/src/Application/ConsoleApplication.php @@ -177,7 +177,7 @@ public function __get($name) default: $trace = debug_backtrace(); trigger_error( - sprintf( + \sprintf( 'Undefined property via __get(): %1$s in %2$s on line %3$s', $name, $trace[0]['file'], @@ -444,7 +444,7 @@ public function flushAssets() */ public function getLongVersion(): string { - return sprintf('Joomla! %s (debug: %s)', (new Version())->getShortVersion(), (\defined('JDEBUG') && JDEBUG ? 'Yes' : 'No')); + return \sprintf('Joomla! %s (debug: %s)', (new Version())->getShortVersion(), (\defined('JDEBUG') && JDEBUG ? 'Yes' : 'No')); } /** diff --git a/libraries/src/Application/DaemonApplication.php b/libraries/src/Application/DaemonApplication.php index ed904ca78a9f6..a68780a9f4a05 100644 --- a/libraries/src/Application/DaemonApplication.php +++ b/libraries/src/Application/DaemonApplication.php @@ -671,7 +671,7 @@ protected function setupSignalHandlers() // Attach the signal handler for the signal. if (!$this->pcntlSignal(\constant($signal), ['DaemonApplication', 'signal'])) { - Log::add(sprintf('Unable to reroute signal handler: %s', $signal), Log::EMERGENCY); + Log::add(\sprintf('Unable to reroute signal handler: %s', $signal), Log::EMERGENCY); return false; } diff --git a/libraries/src/Application/EventAware.php b/libraries/src/Application/EventAware.php index f8a3d75cfa9e7..ff78555627a7c 100644 --- a/libraries/src/Application/EventAware.php +++ b/libraries/src/Application/EventAware.php @@ -94,7 +94,7 @@ public function triggerEvent($eventName, $args = []) try { $dispatcher = $this->getDispatcher(); } catch (\UnexpectedValueException $exception) { - $this->getLogger()->error(sprintf('Dispatcher not set in %s, cannot trigger events.', \get_class($this))); + $this->getLogger()->error(\sprintf('Dispatcher not set in %s, cannot trigger events.', \get_class($this))); return []; } diff --git a/libraries/src/Application/MultiFactorAuthenticationHandler.php b/libraries/src/Application/MultiFactorAuthenticationHandler.php index bcec88ab3f7e8..049ca9fd6afcc 100644 --- a/libraries/src/Application/MultiFactorAuthenticationHandler.php +++ b/libraries/src/Application/MultiFactorAuthenticationHandler.php @@ -419,7 +419,7 @@ private function migrateFromLegacyMFA(): void Factory::getApplication()->bootComponent('com_users')->getMVCFactory()->createTable('Mfa', 'Administrator')->save( [ 'user_id' => $user->id, - 'title' => sprintf("%s %s", Text::_('PLG_MULTIFACTORAUTH_YUBIKEY_METHOD_TITLE'), $config['yubikey']), + 'title' => \sprintf("%s %s", Text::_('PLG_MULTIFACTORAUTH_YUBIKEY_METHOD_TITLE'), $config['yubikey']), 'method' => 'yubikey', 'default' => 0, 'created_on' => Date::getInstance()->toSql(), diff --git a/libraries/src/Application/WebApplication.php b/libraries/src/Application/WebApplication.php index 6b8e435791ada..c1099afc01d09 100644 --- a/libraries/src/Application/WebApplication.php +++ b/libraries/src/Application/WebApplication.php @@ -145,7 +145,7 @@ public static function getInstance($name = null) // Only create the object if it doesn't exist. if (empty(static::$instance)) { if (!is_subclass_of($name, '\\Joomla\\CMS\\Application\\WebApplication')) { - throw new \RuntimeException(sprintf('Unable to load application: %s', $name), 500); + throw new \RuntimeException(\sprintf('Unable to load application: %s', $name), 500); } static::$instance = new $name(); diff --git a/libraries/src/Authentication/Password/ChainedHandler.php b/libraries/src/Authentication/Password/ChainedHandler.php index d24c097190ccc..24ad6a73dc084 100644 --- a/libraries/src/Authentication/Password/ChainedHandler.php +++ b/libraries/src/Authentication/Password/ChainedHandler.php @@ -56,7 +56,7 @@ public function addHandler(HandlerInterface $handler) public function checkIfRehashNeeded(string $hash): bool { foreach ($this->handlers as $handler) { - if ($handler instanceof CheckIfRehashNeededHandlerInterface && $handler->isSupported() && $handler->checkIfRehashNeeded($hash)) { + if ($handler instanceof CheckIfRehashNeededHandlerInterface && $handler::isSupported() && $handler->checkIfRehashNeeded($hash)) { return true; } } @@ -105,7 +105,7 @@ public static function isSupported() public function validatePassword($plaintext, $hashed) { foreach ($this->handlers as $handler) { - if ($handler->isSupported() && $handler->validatePassword($plaintext, $hashed)) { + if ($handler::isSupported() && $handler->validatePassword($plaintext, $hashed)) { return true; } } diff --git a/libraries/src/Cache/Cache.php b/libraries/src/Cache/Cache.php index 9f132ed019cc0..eb9de4a46ee9f 100644 --- a/libraries/src/Cache/Cache.php +++ b/libraries/src/Cache/Cache.php @@ -94,7 +94,7 @@ public function __construct($options) public static function getInstance($type = 'output', $options = []) { @trigger_error( - sprintf( + \sprintf( '%s() is deprecated. The cache controller should be fetched from the factory.', __METHOD__ ), diff --git a/libraries/src/Cache/CacheController.php b/libraries/src/Cache/CacheController.php index d574b7481dce0..2c446ebe29df1 100644 --- a/libraries/src/Cache/CacheController.php +++ b/libraries/src/Cache/CacheController.php @@ -94,7 +94,7 @@ public function __call($name, $arguments) public static function getInstance($type = 'output', $options = []) { @trigger_error( - sprintf( + \sprintf( '%s() is deprecated. The cache controller should be fetched from the factory.', __METHOD__ ), diff --git a/libraries/src/Cache/CacheControllerFactoryAwareTrait.php b/libraries/src/Cache/CacheControllerFactoryAwareTrait.php index 664e6d22919a7..b7a5446bcd246 100644 --- a/libraries/src/Cache/CacheControllerFactoryAwareTrait.php +++ b/libraries/src/Cache/CacheControllerFactoryAwareTrait.php @@ -45,7 +45,7 @@ protected function getCacheControllerFactory(): CacheControllerFactoryInterface } @trigger_error( - sprintf('A cache controller is needed in %s. An UnexpectedValueException will be thrown in 5.0.', __CLASS__), + \sprintf('A cache controller is needed in %s. An UnexpectedValueException will be thrown in 5.0.', __CLASS__), E_USER_DEPRECATED ); diff --git a/libraries/src/Cache/CacheStorage.php b/libraries/src/Cache/CacheStorage.php index 1684cce651e24..d1cf00e177fd3 100644 --- a/libraries/src/Cache/CacheStorage.php +++ b/libraries/src/Cache/CacheStorage.php @@ -162,20 +162,20 @@ public static function getInstance($handler = null, $options = []) $path = Path::find(self::addIncludePath(), strtolower($handler) . '.php'); if ($path === false) { - throw new UnsupportedCacheException(sprintf('Unable to load Cache Storage: %s', $handler)); + throw new UnsupportedCacheException(\sprintf('Unable to load Cache Storage: %s', $handler)); } \JLoader::register($class, $path); // The class should now be loaded if (!class_exists($class)) { - throw new UnsupportedCacheException(sprintf('Unable to load Cache Storage: %s', $handler)); + throw new UnsupportedCacheException(\sprintf('Unable to load Cache Storage: %s', $handler)); } } // Validate the cache storage is supported on this platform if (!$class::isSupported()) { - throw new UnsupportedCacheException(sprintf('The %s Cache Storage is not supported on this platform.', $handler)); + throw new UnsupportedCacheException(\sprintf('The %s Cache Storage is not supported on this platform.', $handler)); } return new $class($options); diff --git a/libraries/src/Cache/Storage/FileStorage.php b/libraries/src/Cache/Storage/FileStorage.php index de8be744fe705..b5bd935ec0dce 100644 --- a/libraries/src/Cache/Storage/FileStorage.php +++ b/libraries/src/Cache/Storage/FileStorage.php @@ -260,9 +260,9 @@ public function clean($group, $mode = null) case 'notgroup': $folders = $this->_folders($this->_root); - for ($i = 0, $n = \count($folders); $i < $n; $i++) { - if ($folders[$i] != $folder) { - $return |= $this->_deleteFolder($this->_root . '/' . $folders[$i]); + foreach ($folders as $value) { + if ($value != $folder) { + $return |= $this->_deleteFolder($this->_root . '/' . $value); } } diff --git a/libraries/src/Captcha/CaptchaRegistry.php b/libraries/src/Captcha/CaptchaRegistry.php index 49c21182083fd..4546b5cbcd132 100644 --- a/libraries/src/Captcha/CaptchaRegistry.php +++ b/libraries/src/Captcha/CaptchaRegistry.php @@ -78,7 +78,7 @@ public function has(string $name): bool public function get(string $name): CaptchaProviderInterface { if (empty($this->registry[$name])) { - throw new CaptchaNotFoundException(sprintf('Captcha element "%s" not found in the registry.', $name)); + throw new CaptchaNotFoundException(\sprintf('Captcha element "%s" not found in the registry.', $name)); } return $this->registry[$name]; diff --git a/libraries/src/Categories/Categories.php b/libraries/src/Categories/Categories.php index 1a4181b69f6af..55bf834755f73 100644 --- a/libraries/src/Categories/Categories.php +++ b/libraries/src/Categories/Categories.php @@ -237,7 +237,7 @@ protected function _load($id) try { $db = $this->getDatabase(); } catch (DatabaseNotFoundException $e) { - @trigger_error(sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED); + @trigger_error(\sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED); $db = Factory::getContainer()->get(DatabaseInterface::class); } diff --git a/libraries/src/Changelog/Changelog.php b/libraries/src/Changelog/Changelog.php index 37ff5c1f8e9b7..ef21696991ab0 100644 --- a/libraries/src/Changelog/Changelog.php +++ b/libraries/src/Changelog/Changelog.php @@ -374,7 +374,7 @@ public function loadFromXml($url) if (!xml_parse($this->xmlParser, $response->body)) { Log::add( - sprintf( + \sprintf( 'XML error: %s at line %d', xml_error_string(xml_get_error_code($this->xmlParser)), xml_get_current_line_number($this->xmlParser) diff --git a/libraries/src/Component/Router/RouterLegacy.php b/libraries/src/Component/Router/RouterLegacy.php index 112f53cc4b7d9..e333d551602d1 100644 --- a/libraries/src/Component/Router/RouterLegacy.php +++ b/libraries/src/Component/Router/RouterLegacy.php @@ -72,10 +72,9 @@ public function build(&$query) if (\function_exists($function)) { $segments = $function($query); - $total = \count($segments); - for ($i = 0; $i < $total; $i++) { - $segments[$i] = str_replace(':', '-', $segments[$i]); + foreach ($segments as &$segment) { + $segment = str_replace(':', '-', $segment); } return $segments; @@ -98,10 +97,8 @@ public function parse(&$segments) $function = $this->component . 'ParseRoute'; if (\function_exists($function)) { - $total = \count($segments); - - for ($i = 0; $i < $total; $i++) { - $segments[$i] = preg_replace('/-/', ':', $segments[$i], 1); + foreach ($segments as &$segment) { + $segment = preg_replace('/-/', ':', $segment, 1); } return $function($segments); diff --git a/libraries/src/Component/Router/Rules/MenuRules.php b/libraries/src/Component/Router/Rules/MenuRules.php index 200b00d0d83ba..9fc82938f5e61 100644 --- a/libraries/src/Component/Router/Rules/MenuRules.php +++ b/libraries/src/Component/Router/Rules/MenuRules.php @@ -46,8 +46,8 @@ class MenuRules implements RulesInterface * System - SEF Plugin parameters * * @var Registry - * @since __DEPLOY_VERSION__ - * @deprecated __DEPLOY_VERSION__ will be removed in 6.0 + * @since 5.2.0 + * @deprecated 5.2.0 will be removed in 6.0 * without replacement */ private $sefparams; diff --git a/libraries/src/Console/FinderIndexCommand.php b/libraries/src/Console/FinderIndexCommand.php index 1d91e843baf16..9c594e9e026ac 100644 --- a/libraries/src/Console/FinderIndexCommand.php +++ b/libraries/src/Console/FinderIndexCommand.php @@ -246,7 +246,7 @@ private function configureIO(InputInterface $input, OutputInterface $output): vo try { $language = $this->getLanguage(); } catch (\UnexpectedValueException $e) { - @trigger_error(sprintf('Language must be set in 6.0 in %s', __METHOD__), E_USER_DEPRECATED); + @trigger_error(\sprintf('Language must be set in 6.0 in %s', __METHOD__), E_USER_DEPRECATED); $language = Factory::getLanguage(); } diff --git a/libraries/src/Console/Loader/WritableContainerLoader.php b/libraries/src/Console/Loader/WritableContainerLoader.php index e41b0d789da01..7d5efc0fc95f9 100644 --- a/libraries/src/Console/Loader/WritableContainerLoader.php +++ b/libraries/src/Console/Loader/WritableContainerLoader.php @@ -82,7 +82,7 @@ public function add(string $commandName, string $className) public function get(string $name): AbstractCommand { if (!$this->has($name)) { - throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); + throw new CommandNotFoundException(\sprintf('Command "%s" does not exist.', $name)); } return $this->container->get($this->commandMap[$name]); diff --git a/libraries/src/Console/RemoveOldFilesCommand.php b/libraries/src/Console/RemoveOldFilesCommand.php index 7ea3c970e5eef..26362cccdacd2 100644 --- a/libraries/src/Console/RemoveOldFilesCommand.php +++ b/libraries/src/Console/RemoveOldFilesCommand.php @@ -99,7 +99,7 @@ protected function doExecute(InputInterface $input, OutputInterface $output): in } $symfonyStyle->success( - sprintf( + \sprintf( $dryRun ? '%s Files checked and %s would be deleted' : '%s Files checked and %s deleted', \count($status['files_checked']), ($dryRun ? \count($status['files_exist']) : \count($status['files_deleted'])) @@ -107,7 +107,7 @@ protected function doExecute(InputInterface $input, OutputInterface $output): in ); $symfonyStyle->success( - sprintf( + \sprintf( $dryRun ? '%s Folders checked and %s would be deleted' : '%s Folders checked and %s deleted', \count($status['folders_checked']), ($dryRun ? \count($status['folders_exist']) : \count($status['folders_deleted'])) diff --git a/libraries/src/Console/SessionGcCommand.php b/libraries/src/Console/SessionGcCommand.php index c7b5ee557a09a..b49d72a1e4a16 100644 --- a/libraries/src/Console/SessionGcCommand.php +++ b/libraries/src/Console/SessionGcCommand.php @@ -107,7 +107,7 @@ private function getSessionService(string $application): SessionInterface { if (!$this->getContainer()->has("session.web.$application")) { throw new \InvalidArgumentException( - sprintf( + \sprintf( 'The `%s` application is not a valid option.', $application ) diff --git a/libraries/src/Console/TasksRunCommand.php b/libraries/src/Console/TasksRunCommand.php index 3a5db7de13928..3d09eeecd8b1b 100644 --- a/libraries/src/Console/TasksRunCommand.php +++ b/libraries/src/Console/TasksRunCommand.php @@ -107,7 +107,7 @@ protected function doExecute(InputInterface $input, OutputInterface $output): in $exit = empty($task) ? Status::NO_RUN : $task->getContent()['status']; $duration = microtime(true) - $cStart; $key = (\array_key_exists($exit, $outTextMap)) ? $exit : 'N/A'; - $this->ioStyle->writeln(sprintf($outTextMap[$key], $record->id, $record->title, $duration, $exit)); + $this->ioStyle->writeln(\sprintf($outTextMap[$key], $record->id, $record->title, $duration, $exit)); } $netTime = round(microtime(true) - $status['startTime'], 2); diff --git a/libraries/src/Document/Document.php b/libraries/src/Document/Document.php index 7ef30a00167b9..1d42437f031c1 100644 --- a/libraries/src/Document/Document.php +++ b/libraries/src/Document/Document.php @@ -977,7 +977,7 @@ public function setModifiedDate($date) { if (!\is_string($date) && !($date instanceof Date)) { throw new \InvalidArgumentException( - sprintf( + \sprintf( 'The $date parameter of %1$s must be a string or a %2$s instance, a %3$s was given.', __METHOD__ . '()', 'Joomla\\CMS\\Date\\Date', @@ -1197,7 +1197,7 @@ protected function preloadAssets() } elseif (\in_array($preloadMethod, $this->preloadTypes)) { $this->getPreloadManager()->$preloadMethod($link); } else { - throw new \InvalidArgumentException(sprintf('The "%s" method is not supported for preloading.', $preloadMethod), 500); + throw new \InvalidArgumentException(\sprintf('The "%s" method is not supported for preloading.', $preloadMethod), 500); } } } @@ -1215,7 +1215,7 @@ protected function preloadAssets() } elseif (\in_array($preloadMethod, $this->preloadTypes)) { $this->getPreloadManager()->$preloadMethod($link); } else { - throw new \InvalidArgumentException(sprintf('The "%s" method is not supported for preloading.', $preloadMethod), 500); + throw new \InvalidArgumentException(\sprintf('The "%s" method is not supported for preloading.', $preloadMethod), 500); } } } diff --git a/libraries/src/Document/Factory.php b/libraries/src/Document/Factory.php index 4db13db833b9f..3dfb172a43ade 100644 --- a/libraries/src/Document/Factory.php +++ b/libraries/src/Document/Factory.php @@ -98,7 +98,7 @@ public function createRenderer(Document $document, string $type, string $docType $class = '\\JDocumentRenderer' . $type; if (!class_exists($class)) { - throw new \RuntimeException(sprintf('Unable to load renderer class %s', $type), 500); + throw new \RuntimeException(\sprintf('Unable to load renderer class %s', $type), 500); } } diff --git a/libraries/src/Document/Renderer/Feed/AtomRenderer.php b/libraries/src/Document/Renderer/Feed/AtomRenderer.php index 3519cb4f7a567..129486ceefa1e 100644 --- a/libraries/src/Document/Renderer/Feed/AtomRenderer.php +++ b/libraries/src/Document/Renderer/Feed/AtomRenderer.php @@ -123,63 +123,63 @@ public function render($name = '', $params = null, $content = null) $feed .= " " . $data->getGenerator() . "\n"; $feed .= " \n"; - for ($i = 0, $count = \count($data->items); $i < $count; $i++) { - $itemlink = $data->items[$i]->link; + foreach ($data->items as $item) { + $itemlink = $item->link; if (preg_match('/[\x80-\xFF]/', $itemlink)) { $itemlink = implode('/', array_map('rawurlencode', explode('/', $itemlink))); } $feed .= " \n"; - $feed .= " " . htmlspecialchars(strip_tags($data->items[$i]->title), ENT_COMPAT, 'UTF-8') . "\n"; + $feed .= " " . htmlspecialchars(strip_tags($item->title), ENT_COMPAT, 'UTF-8') . "\n"; $feed .= " \n"; - if ($data->items[$i]->date == '') { - $data->items[$i]->date = $now->toUnix(); + if ($item->date == '') { + $item->date = $now->toUnix(); } - $itemDate = Factory::getDate($data->items[$i]->date); + $itemDate = Factory::getDate($item->date); $itemDate->setTimezone($tz); $feed .= " " . htmlspecialchars($itemDate->toISO8601(true), ENT_COMPAT, 'UTF-8') . "\n"; $feed .= " " . htmlspecialchars($itemDate->toISO8601(true), ENT_COMPAT, 'UTF-8') . "\n"; - if (empty($data->items[$i]->guid)) { + if (empty($item->guid)) { $itemGuid = str_replace(' ', '%20', $url . $itemlink); } else { - $itemGuid = htmlspecialchars($data->items[$i]->guid, ENT_COMPAT, 'UTF-8'); + $itemGuid = htmlspecialchars($item->guid, ENT_COMPAT, 'UTF-8'); } $feed .= " " . $itemGuid . "\n"; - if ($data->items[$i]->author != '') { + if ($item->author != '') { $feed .= " \n"; - $feed .= " " . htmlspecialchars($data->items[$i]->author, ENT_COMPAT, 'UTF-8') . "\n"; + $feed .= " " . htmlspecialchars($item->author, ENT_COMPAT, 'UTF-8') . "\n"; - if (!empty($data->items[$i]->authorEmail)) { - $feed .= " " . htmlspecialchars($data->items[$i]->authorEmail, ENT_COMPAT, 'UTF-8') . "\n"; + if (!empty($item->authorEmail)) { + $feed .= " " . htmlspecialchars($item->authorEmail, ENT_COMPAT, 'UTF-8') . "\n"; } $feed .= " \n"; } - if (!empty($data->items[$i]->description)) { - $feed .= " " . htmlspecialchars($this->_relToAbs($data->items[$i]->description), ENT_COMPAT, 'UTF-8') . "\n"; - $feed .= " " . htmlspecialchars($this->_relToAbs($data->items[$i]->description), ENT_COMPAT, 'UTF-8') . "\n"; + if (!empty($item->description)) { + $feed .= " " . htmlspecialchars($this->_relToAbs($item->description), ENT_COMPAT, 'UTF-8') . "\n"; + $feed .= " " . htmlspecialchars($this->_relToAbs($item->description), ENT_COMPAT, 'UTF-8') . "\n"; } - if (!empty($data->items[$i]->category)) { - if (\is_array($data->items[$i]->category)) { - foreach ($data->items[$i]->category as $cat) { + if (!empty($item->category)) { + if (\is_array($item->category)) { + foreach ($item->category as $cat) { $feed .= " \n"; } } else { - $feed .= " items[$i]->category, ENT_COMPAT, 'UTF-8') . "\" />\n"; + $feed .= " category, ENT_COMPAT, 'UTF-8') . "\" />\n"; } } - if ($data->items[$i]->enclosure != null) { - $feed .= " items[$i]->enclosure->url . "\" type=\"" - . $data->items[$i]->enclosure->type . "\" length=\"" . $data->items[$i]->enclosure->length . "\"/>\n"; + if ($item->enclosure != null) { + $feed .= " enclosure->url . "\" type=\"" + . $item->enclosure->type . "\" length=\"" . $item->enclosure->length . "\"/>\n"; } $feed .= " \n"; diff --git a/libraries/src/Document/Renderer/Feed/RssRenderer.php b/libraries/src/Document/Renderer/Feed/RssRenderer.php index 9c6d533027cb0..5522faec5b00a 100644 --- a/libraries/src/Document/Renderer/Feed/RssRenderer.php +++ b/libraries/src/Document/Renderer/Feed/RssRenderer.php @@ -166,8 +166,8 @@ public function render($name = '', $params = null, $content = null) $feed .= " " . htmlspecialchars($data->skipDays, ENT_COMPAT, 'UTF-8') . "\n"; } - for ($i = 0, $count = \count($data->items); $i < $count; $i++) { - $itemlink = $data->items[$i]->link; + foreach ($data->items as $item) { + $itemlink = $item->link; if (preg_match('/[\x80-\xFF]/', $itemlink)) { $itemlink = implode('/', array_map('rawurlencode', explode('/', $itemlink))); @@ -178,20 +178,20 @@ public function render($name = '', $params = null, $content = null) } $feed .= " \n"; - $feed .= " " . htmlspecialchars(strip_tags($data->items[$i]->title), ENT_COMPAT, 'UTF-8') . "\n"; + $feed .= " " . htmlspecialchars(strip_tags($item->title), ENT_COMPAT, 'UTF-8') . "\n"; $feed .= " " . str_replace(' ', '%20', $itemlink) . "\n"; - if (empty($data->items[$i]->guid)) { + if (empty($item->guid)) { $feed .= " " . str_replace(' ', '%20', $itemlink) . "\n"; } else { - $feed .= " " . htmlspecialchars($data->items[$i]->guid, ENT_COMPAT, 'UTF-8') . "\n"; + $feed .= " " . htmlspecialchars($item->guid, ENT_COMPAT, 'UTF-8') . "\n"; } - $feed .= " _relToAbs($data->items[$i]->description) . "]]>\n"; + $feed .= " _relToAbs($item->description) . "]]>\n"; - if ($data->items[$i]->authorEmail != '') { + if ($item->authorEmail != '') { $feed .= ' ' - . htmlspecialchars($data->items[$i]->authorEmail . ' (' . $data->items[$i]->author . ')', ENT_COMPAT, 'UTF-8') . "\n"; + . htmlspecialchars($item->authorEmail . ' (' . $item->author . ')', ENT_COMPAT, 'UTF-8') . "\n"; } /* @@ -202,33 +202,33 @@ public function render($name = '', $params = null, $content = null) * } */ - if (empty($data->items[$i]->category) === false) { - if (\is_array($data->items[$i]->category)) { - foreach ($data->items[$i]->category as $cat) { + if (empty($item->category) === false) { + if (\is_array($item->category)) { + foreach ($item->category as $cat) { $feed .= " " . htmlspecialchars($cat, ENT_COMPAT, 'UTF-8') . "\n"; } } else { - $feed .= " " . htmlspecialchars($data->items[$i]->category, ENT_COMPAT, 'UTF-8') . "\n"; + $feed .= " " . htmlspecialchars($item->category, ENT_COMPAT, 'UTF-8') . "\n"; } } - if ($data->items[$i]->comments != '') { - $feed .= " " . htmlspecialchars($data->items[$i]->comments, ENT_COMPAT, 'UTF-8') . "\n"; + if ($item->comments != '') { + $feed .= " " . htmlspecialchars($item->comments, ENT_COMPAT, 'UTF-8') . "\n"; } - if ($data->items[$i]->date != '') { - $itemDate = Factory::getDate($data->items[$i]->date); + if ($item->date != '') { + $itemDate = Factory::getDate($item->date); $itemDate->setTimezone($tz); $feed .= " " . htmlspecialchars($itemDate->toRFC822(true), ENT_COMPAT, 'UTF-8') . "\n"; } - if ($data->items[$i]->enclosure != null) { + if ($item->enclosure != null) { $feed .= " items[$i]->enclosure->url; + $feed .= $item->enclosure->url; $feed .= "\" length=\""; - $feed .= $data->items[$i]->enclosure->length; + $feed .= $item->enclosure->length; $feed .= "\" type=\""; - $feed .= $data->items[$i]->enclosure->type; + $feed .= $item->enclosure->type; $feed .= "\"/>\n"; } diff --git a/libraries/src/Document/Renderer/Html/ScriptsRenderer.php b/libraries/src/Document/Renderer/Html/ScriptsRenderer.php index 65cc0674444d5..e329fcf62c3e4 100644 --- a/libraries/src/Document/Renderer/Html/ScriptsRenderer.php +++ b/libraries/src/Document/Renderer/Html/ScriptsRenderer.php @@ -165,7 +165,7 @@ private function renderElement($item): string if ($asset->getOption('deprecated')) { @trigger_error( - sprintf('Web Asset script [%s] is deprecated. %s', $asset->getName(), $asset->getOption('deprecatedMsg', '')), + \sprintf('Web Asset script [%s] is deprecated. %s', $asset->getName(), $asset->getOption('deprecatedMsg', '')), E_USER_DEPRECATED ); } diff --git a/libraries/src/Document/Renderer/Html/StylesRenderer.php b/libraries/src/Document/Renderer/Html/StylesRenderer.php index e1cd1a98aefa3..ccf55920e2a1e 100644 --- a/libraries/src/Document/Renderer/Html/StylesRenderer.php +++ b/libraries/src/Document/Renderer/Html/StylesRenderer.php @@ -154,7 +154,7 @@ private function renderElement($item): string if ($asset->getOption('deprecated')) { @trigger_error( - sprintf('Web Asset style [%s] is deprecated. %s', $asset->getName(), $asset->getOption('deprecatedMsg', '')), + \sprintf('Web Asset style [%s] is deprecated. %s', $asset->getName(), $asset->getOption('deprecatedMsg', '')), E_USER_DEPRECATED ); } @@ -194,10 +194,10 @@ private function renderElement($item): string // Render the element with attributes $buffer .= 'renderAttributes($attribs); - $buffer .= ' />'; + $buffer .= '>'; if ($relation === 'lazy-stylesheet') { - $buffer .= ''; + $buffer .= ''; } // This is for IE conditional statements support. diff --git a/libraries/src/Editor/EditorsRegistry.php b/libraries/src/Editor/EditorsRegistry.php index ec0712b671bcf..669deab8e7f1a 100644 --- a/libraries/src/Editor/EditorsRegistry.php +++ b/libraries/src/Editor/EditorsRegistry.php @@ -78,7 +78,7 @@ public function has(string $name): bool public function get(string $name): EditorProviderInterface { if (empty($this->registry[$name])) { - throw new EditorNotFoundException(sprintf('Editor element "%s" not found in the registry.', $name)); + throw new EditorNotFoundException(\sprintf('Editor element "%s" not found in the registry.', $name)); } return $this->registry[$name]; diff --git a/libraries/src/Encrypt/Base32.php b/libraries/src/Encrypt/Base32.php index d0c938bae2a84..1efa8fd97d0c6 100644 --- a/libraries/src/Encrypt/Base32.php +++ b/libraries/src/Encrypt/Base32.php @@ -215,6 +215,6 @@ private function _mapcharset($str) */ private function _mapbin($chr) { - return sprintf('%08b', strpos(self::CSRFC3548, $chr)); + return \sprintf('%08b', strpos(self::CSRFC3548, $chr)); } } diff --git a/libraries/src/Encrypt/Totp.php b/libraries/src/Encrypt/Totp.php index 9c243a42b9068..395e378ac8eef 100644 --- a/libraries/src/Encrypt/Totp.php +++ b/libraries/src/Encrypt/Totp.php @@ -180,7 +180,7 @@ protected function hashToInt($bytes, $start) */ public function getUrl($user, $hostname, $secret) { - $url = sprintf("otpauth://totp/%s@%s?secret=%s", $user, $hostname, $secret); + $url = \sprintf("otpauth://totp/%s@%s?secret=%s", $user, $hostname, $secret); $encoder = "https://chart.googleapis.com/chart?chs=200x200&chld=Q|2&cht=qr&chl="; $encoderURL = $encoder . urlencode($url); diff --git a/libraries/src/Error/AbstractRenderer.php b/libraries/src/Error/AbstractRenderer.php index 4f21e5138b7cb..c9a2e99624ad7 100644 --- a/libraries/src/Error/AbstractRenderer.php +++ b/libraries/src/Error/AbstractRenderer.php @@ -83,7 +83,7 @@ public static function getRenderer(string $type) } // 404 Resource Not Found - throw new \InvalidArgumentException(sprintf('There is not an error renderer for the "%s" format.', $type)); + throw new \InvalidArgumentException(\sprintf('There is not an error renderer for the "%s" format.', $type)); } /** diff --git a/libraries/src/Event/AbstractEvent.php b/libraries/src/Event/AbstractEvent.php index c5d150074e0bc..18743fdb2945c 100644 --- a/libraries/src/Event/AbstractEvent.php +++ b/libraries/src/Event/AbstractEvent.php @@ -144,7 +144,7 @@ public function getArgument($name, $default = null) } @trigger_error( - sprintf( + \sprintf( 'Numeric access to named event arguments is deprecated, and will not work in Joomla 6. Event %s argument %s', \get_class($this), $name @@ -166,7 +166,7 @@ public function getArgument($name, $default = null) if (method_exists($this, $methodName2)) { @trigger_error( - sprintf( + \sprintf( 'Use method "%s" for value pre-processing is deprecated, and will not work in Joomla 6. Use "%s" instead. Event %s', $methodName2, $methodName1, @@ -209,7 +209,7 @@ public function setArgument($name, $value) } @trigger_error( - sprintf( + \sprintf( 'Numeric access to named event arguments is deprecated, and will not work in Joomla 6. Event %s argument %s', \get_class($this), $name @@ -227,7 +227,7 @@ public function setArgument($name, $value) $value = $this->{$methodName1}($value); } elseif (method_exists($this, $methodName2)) { @trigger_error( - sprintf( + \sprintf( 'Use method "%s" for value pre-processing is deprecated, and will not work in Joomla 6. Use "%s" instead. Event %s', $methodName2, $methodName1, diff --git a/libraries/src/Event/AbstractImmutableEvent.php b/libraries/src/Event/AbstractImmutableEvent.php index 2b27101360b9e..d877251fba172 100644 --- a/libraries/src/Event/AbstractImmutableEvent.php +++ b/libraries/src/Event/AbstractImmutableEvent.php @@ -42,7 +42,7 @@ public function __construct(string $name, array $arguments = []) { if ($this->constructed) { throw new \BadMethodCallException( - sprintf('Cannot reconstruct the AbstractImmutableEvent %s.', $this->name) + \sprintf('Cannot reconstruct the AbstractImmutableEvent %s.', $this->name) ); } @@ -77,7 +77,7 @@ public function offsetSet($name, $value) } throw new \BadMethodCallException( - sprintf( + \sprintf( 'Cannot set the argument %s of the immutable event %s.', $name, $this->name @@ -98,7 +98,7 @@ public function offsetSet($name, $value) public function offsetUnset($name) { throw new \BadMethodCallException( - sprintf( + \sprintf( 'Cannot remove the argument %s of the immutable event %s.', $name, $this->name diff --git a/libraries/src/Event/Content/ContentPrepareEvent.php b/libraries/src/Event/Content/ContentPrepareEvent.php index 492c7e7b105cf..87f7f6d198414 100644 --- a/libraries/src/Event/Content/ContentPrepareEvent.php +++ b/libraries/src/Event/Content/ContentPrepareEvent.php @@ -65,7 +65,7 @@ protected function onSetParams($value): Registry // @TODO: In 6.0 throw an exception @trigger_error( - sprintf('The "params" attribute for the event "%s" must be type of Registry. In 6.0 it will throw an exception', $this->getName()), + \sprintf('The "params" attribute for the event "%s" must be type of Registry. In 6.0 it will throw an exception', $this->getName()), E_USER_DEPRECATED ); } diff --git a/libraries/src/Event/Extension/AbstractJoomlaUpdateEvent.php b/libraries/src/Event/Extension/AbstractJoomlaUpdateEvent.php index dd63377a7cd2b..5501f55316de2 100644 --- a/libraries/src/Event/Extension/AbstractJoomlaUpdateEvent.php +++ b/libraries/src/Event/Extension/AbstractJoomlaUpdateEvent.php @@ -19,7 +19,7 @@ /** * Base class for Joomla Update events * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ abstract class AbstractJoomlaUpdateEvent extends AbstractImmutableEvent { @@ -30,8 +30,8 @@ abstract class AbstractJoomlaUpdateEvent extends AbstractImmutableEvent * * @var array * - * @since __DEPLOY_VERSION__ - * @deprecated __DEPLOY_VERSION__ will be removed in 6.0 + * @since 5.2.0 + * @deprecated 5.2.0 will be removed in 6.0 */ protected $legacyArgumentsOrder = []; @@ -41,7 +41,7 @@ abstract class AbstractJoomlaUpdateEvent extends AbstractImmutableEvent * @param string $name The event name. * @param array $arguments The event arguments. * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ public function __construct($name, array $arguments = []) { diff --git a/libraries/src/Event/Extension/AfterJoomlaUpdateEvent.php b/libraries/src/Event/Extension/AfterJoomlaUpdateEvent.php index 46672bbec59de..cb8642c977e93 100644 --- a/libraries/src/Event/Extension/AfterJoomlaUpdateEvent.php +++ b/libraries/src/Event/Extension/AfterJoomlaUpdateEvent.php @@ -16,7 +16,7 @@ /** * Class for Joomla Update events * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ class AfterJoomlaUpdateEvent extends AbstractJoomlaUpdateEvent { @@ -25,8 +25,8 @@ class AfterJoomlaUpdateEvent extends AbstractJoomlaUpdateEvent * * @var array * - * @since __DEPLOY_VERSION__ - * @deprecated __DEPLOY_VERSION__ will be removed in 6.0 + * @since 5.2.0 + * @deprecated 5.2.0 will be removed in 6.0 */ protected $legacyArgumentsOrder = ['oldVersion']; @@ -37,7 +37,7 @@ class AfterJoomlaUpdateEvent extends AbstractJoomlaUpdateEvent * * @return string * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ protected function onSetOldVersion(?string $value): string { @@ -49,7 +49,7 @@ protected function onSetOldVersion(?string $value): string * * @return string * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ public function getOldVersion(): string { diff --git a/libraries/src/Event/Extension/BeforeJoomlaUpdateEvent.php b/libraries/src/Event/Extension/BeforeJoomlaUpdateEvent.php index 635cee88ebc26..c708a6474e44c 100644 --- a/libraries/src/Event/Extension/BeforeJoomlaUpdateEvent.php +++ b/libraries/src/Event/Extension/BeforeJoomlaUpdateEvent.php @@ -16,7 +16,7 @@ /** * Class for Joomla Update events * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ class BeforeJoomlaUpdateEvent extends AbstractJoomlaUpdateEvent { diff --git a/libraries/src/Event/Mail/BeforeRenderingMailTemplateEvent.php b/libraries/src/Event/Mail/BeforeRenderingMailTemplateEvent.php index 438e0e9d30dff..34d1588f279a7 100644 --- a/libraries/src/Event/Mail/BeforeRenderingMailTemplateEvent.php +++ b/libraries/src/Event/Mail/BeforeRenderingMailTemplateEvent.php @@ -14,7 +14,7 @@ * Example: * new BeforeRenderingMailTemplateEvent('onEventName', ['templateId' => 'com_example.template', 'subject' => $mailTemplateInstance]); * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ class BeforeRenderingMailTemplateEvent extends MailTemplateEvent { @@ -23,8 +23,8 @@ class BeforeRenderingMailTemplateEvent extends MailTemplateEvent * * @var array * - * @since __DEPLOY_VERSION__ - * @deprecated __DEPLOY_VERSION__ will be removed in 6.0 + * @since 5.2.0 + * @deprecated 5.2.0 will be removed in 6.0 */ protected $legacyArgumentsOrder = ['templateId', 'subject']; } diff --git a/libraries/src/Event/Mail/MailTemplateEvent.php b/libraries/src/Event/Mail/MailTemplateEvent.php index 57719d3c40adc..33092ece15aca 100644 --- a/libraries/src/Event/Mail/MailTemplateEvent.php +++ b/libraries/src/Event/Mail/MailTemplateEvent.php @@ -20,7 +20,7 @@ /** * Base class for MailTemplate events * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ abstract class MailTemplateEvent extends AbstractImmutableEvent { @@ -31,8 +31,8 @@ abstract class MailTemplateEvent extends AbstractImmutableEvent * * @var array * - * @since __DEPLOY_VERSION__ - * @deprecated __DEPLOY_VERSION__ will be removed in 6.0 + * @since 5.2.0 + * @deprecated 5.2.0 will be removed in 6.0 */ protected $legacyArgumentsOrder = []; @@ -44,7 +44,7 @@ abstract class MailTemplateEvent extends AbstractImmutableEvent * * @throws \BadMethodCallException * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ public function __construct($name, array $arguments = []) { @@ -71,7 +71,7 @@ public function __construct($name, array $arguments = []) * * @return MailTemplate * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ protected function onSetSubject(MailTemplate $value): MailTemplate { @@ -85,7 +85,7 @@ protected function onSetSubject(MailTemplate $value): MailTemplate * * @return MailTemplate * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ protected function onGetSubject(MailTemplate $value): MailTemplate { @@ -99,7 +99,7 @@ protected function onGetSubject(MailTemplate $value): MailTemplate * * @return string * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ protected function onSetTemplateId(string $value): string { @@ -113,7 +113,7 @@ protected function onSetTemplateId(string $value): string * * @return string * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ protected function onGetTemplateId(string $value): string { @@ -125,7 +125,7 @@ protected function onGetTemplateId(string $value): string * * @return MailTemplate * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ public function getTemplate(): MailTemplate { @@ -137,7 +137,7 @@ public function getTemplate(): MailTemplate * * @return string * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ public function getTemplateId(): string { diff --git a/libraries/src/Event/MultiFactor/BeforeDisplayMethods.php b/libraries/src/Event/MultiFactor/BeforeDisplayMethods.php index e1b5be9cabdac..15864b872a972 100644 --- a/libraries/src/Event/MultiFactor/BeforeDisplayMethods.php +++ b/libraries/src/Event/MultiFactor/BeforeDisplayMethods.php @@ -52,7 +52,7 @@ public function __construct(User $user) public function setUser(User $value): User { if (empty($value) || ($value->id <= 0) || ($value->guest == 1)) { - throw new \DomainException(sprintf('Argument \'user\' of event %s must be a non-guest User object.', $this->name)); + throw new \DomainException(\sprintf('Argument \'user\' of event %s must be a non-guest User object.', $this->name)); } return $value; diff --git a/libraries/src/Event/MultiFactor/Callback.php b/libraries/src/Event/MultiFactor/Callback.php index 89957e6a8c329..72d5be7bbb813 100644 --- a/libraries/src/Event/MultiFactor/Callback.php +++ b/libraries/src/Event/MultiFactor/Callback.php @@ -49,7 +49,7 @@ public function __construct(string $method) public function setMethod(string $value): string { if (empty($value)) { - throw new \DomainException(sprintf("Argument 'method' of event %s must be a non-empty string.", $this->name)); + throw new \DomainException(\sprintf("Argument 'method' of event %s must be a non-empty string.", $this->name)); } return $value; diff --git a/libraries/src/Event/MultiFactor/Captive.php b/libraries/src/Event/MultiFactor/Captive.php index dc113a27aaab9..13bbe1001b4eb 100644 --- a/libraries/src/Event/MultiFactor/Captive.php +++ b/libraries/src/Event/MultiFactor/Captive.php @@ -61,7 +61,7 @@ public function __construct(MfaTable $record) public function setRecord(MfaTable $value): MfaTable { if (empty($value)) { - throw new \DomainException(sprintf('Argument \'record\' of event %s must be a MfaTable object.', $this->name)); + throw new \DomainException(\sprintf('Argument \'record\' of event %s must be a MfaTable object.', $this->name)); } return $value; diff --git a/libraries/src/Event/MultiFactor/GetSetup.php b/libraries/src/Event/MultiFactor/GetSetup.php index 4254f1240cf44..ed3ea61520702 100644 --- a/libraries/src/Event/MultiFactor/GetSetup.php +++ b/libraries/src/Event/MultiFactor/GetSetup.php @@ -61,7 +61,7 @@ public function __construct(MfaTable $record) public function setRecord(MfaTable $value): MfaTable { if (empty($value)) { - throw new \DomainException(sprintf('Argument \'record\' of event %s must be a MfaTable object.', $this->name)); + throw new \DomainException(\sprintf('Argument \'record\' of event %s must be a MfaTable object.', $this->name)); } return $value; diff --git a/libraries/src/Event/MultiFactor/NotifyActionLog.php b/libraries/src/Event/MultiFactor/NotifyActionLog.php index e8cde3eefe8dd..a7eb152331fac 100644 --- a/libraries/src/Event/MultiFactor/NotifyActionLog.php +++ b/libraries/src/Event/MultiFactor/NotifyActionLog.php @@ -52,7 +52,7 @@ class NotifyActionLog extends AbstractImmutableEvent public function __construct(string $name, array $arguments = []) { if (!\in_array($name, self::ACCEPTABLE_EVENTS)) { - throw new \InvalidArgumentException(sprintf('The %s event class does not support the %s event name.', __CLASS__, $name)); + throw new \InvalidArgumentException(\sprintf('The %s event class does not support the %s event name.', __CLASS__, $name)); } parent::__construct($name, $arguments); diff --git a/libraries/src/Event/MultiFactor/SaveSetup.php b/libraries/src/Event/MultiFactor/SaveSetup.php index a696ebe5eb8d3..014df273b5cc8 100644 --- a/libraries/src/Event/MultiFactor/SaveSetup.php +++ b/libraries/src/Event/MultiFactor/SaveSetup.php @@ -65,7 +65,7 @@ public function __construct(MfaTable $record, Input $input) public function setRecord(MfaTable $value): MfaTable { if (empty($value)) { - throw new \DomainException(sprintf('Argument \'record\' of event %s must be a MfaTable object.', $this->name)); + throw new \DomainException(\sprintf('Argument \'record\' of event %s must be a MfaTable object.', $this->name)); } return $value; @@ -85,7 +85,7 @@ public function setRecord(MfaTable $value): MfaTable public function setInput(Input $value): Input { if (empty($value)) { - throw new \DomainException(sprintf('Argument \'input\' of event %s must be an Input object.', $this->name)); + throw new \DomainException(\sprintf('Argument \'input\' of event %s must be an Input object.', $this->name)); } return $value; diff --git a/libraries/src/Event/MultiFactor/Validate.php b/libraries/src/Event/MultiFactor/Validate.php index 7fd77893b59f6..272c59c0cec84 100644 --- a/libraries/src/Event/MultiFactor/Validate.php +++ b/libraries/src/Event/MultiFactor/Validate.php @@ -65,7 +65,7 @@ public function __construct(MfaTable $record, User $user, string $code) public function setRecord(MfaTable $value): MfaTable { if (empty($value)) { - throw new \DomainException(sprintf('Argument \'record\' of event %s must be a MfaTable object.', $this->name)); + throw new \DomainException(\sprintf('Argument \'record\' of event %s must be a MfaTable object.', $this->name)); } return $value; @@ -85,7 +85,7 @@ public function setRecord(MfaTable $value): MfaTable public function setUser(User $value): User { if (empty($value) || ($value->id <= 0) || ($value->guest == 1)) { - throw new \DomainException(sprintf('Argument \'user\' of event %s must be a non-guest User object.', $this->name)); + throw new \DomainException(\sprintf('Argument \'user\' of event %s must be a non-guest User object.', $this->name)); } return $value; diff --git a/libraries/src/Event/Plugin/System/Webauthn/AjaxChallenge.php b/libraries/src/Event/Plugin/System/Webauthn/AjaxChallenge.php index d4880fc430eb7..b55c91872aefc 100644 --- a/libraries/src/Event/Plugin/System/Webauthn/AjaxChallenge.php +++ b/libraries/src/Event/Plugin/System/Webauthn/AjaxChallenge.php @@ -41,7 +41,7 @@ public function typeCheckResult($data): void } if (!\is_string($data) || @json_decode($data) === null) { - throw new \InvalidArgumentException(sprintf('Event %s only accepts JSON results.', $this->getName())); + throw new \InvalidArgumentException(\sprintf('Event %s only accepts JSON results.', $this->getName())); } } } diff --git a/libraries/src/Event/Privacy/CanRemoveDataEvent.php b/libraries/src/Event/Privacy/CanRemoveDataEvent.php index c20235d3af2b8..c0c94731a2526 100644 --- a/libraries/src/Event/Privacy/CanRemoveDataEvent.php +++ b/libraries/src/Event/Privacy/CanRemoveDataEvent.php @@ -105,7 +105,7 @@ protected function onSetUser(?User $value): ?User public function typeCheckResult($data): void { if (!$data instanceof Status) { - throw new \InvalidArgumentException(sprintf('Event %s only accepts Joomla\Component\Privacy\Administrator\Removal\Status results.', \get_class($this))); + throw new \InvalidArgumentException(\sprintf('Event %s only accepts Joomla\Component\Privacy\Administrator\Removal\Status results.', \get_class($this))); } } diff --git a/libraries/src/Event/Privacy/ExportRequestEvent.php b/libraries/src/Event/Privacy/ExportRequestEvent.php index 74b94aed61213..91462ddaf2ade 100644 --- a/libraries/src/Event/Privacy/ExportRequestEvent.php +++ b/libraries/src/Event/Privacy/ExportRequestEvent.php @@ -129,14 +129,14 @@ public function getUser(): ?User public function typeCheckResult($data): void { if (!\is_array($data)) { - throw new \InvalidArgumentException(sprintf('Event %s only accepts Array results.', \get_class($this))); + throw new \InvalidArgumentException(\sprintf('Event %s only accepts Array results.', \get_class($this))); } // Validate items in array foreach ($data as $item) { if (!$item instanceof Domain) { throw new \InvalidArgumentException( - sprintf( + \sprintf( 'Event %s only accepts Joomla\Component\Privacy\Administrator\Export\Domain in result array.', \get_class($this) ) diff --git a/libraries/src/Event/QuickIcon/GetIconEvent.php b/libraries/src/Event/QuickIcon/GetIconEvent.php index 084d77f6d9c9c..4b7f47970dc98 100644 --- a/libraries/src/Event/QuickIcon/GetIconEvent.php +++ b/libraries/src/Event/QuickIcon/GetIconEvent.php @@ -61,7 +61,7 @@ public function __construct(string $name, array $arguments = []) public function setContext(string $value) { if (empty($value)) { - throw new \DomainException(sprintf("Argument 'context' of event %s must be a non-empty string.", $this->name)); + throw new \DomainException(\sprintf("Argument 'context' of event %s must be a non-empty string.", $this->name)); } return $value; diff --git a/libraries/src/Event/Result/ResultAware.php b/libraries/src/Event/Result/ResultAware.php index 07c528c259aac..e3045abc78d6f 100644 --- a/libraries/src/Event/Result/ResultAware.php +++ b/libraries/src/Event/Result/ResultAware.php @@ -51,12 +51,12 @@ public function addResult($data): void { // Ensure this trait is applied to an Event object. if (!($this instanceof BaseEvent)) { - throw new \LogicException(sprintf('Event class ‘%s‘ must implement %s.', \get_class($this), BaseEvent::class)); + throw new \LogicException(\sprintf('Event class ‘%s‘ must implement %s.', \get_class($this), BaseEvent::class)); } // Ensure the Event object fully implements the ResultAwareInterface. if (!($this instanceof ResultAwareInterface)) { - throw new \LogicException(sprintf('Event class ‘%s‘ must implement %s.', \get_class($this), ResultAwareInterface::class)); + throw new \LogicException(\sprintf('Event class ‘%s‘ must implement %s.', \get_class($this), ResultAwareInterface::class)); } // Make sure the data type is correct diff --git a/libraries/src/Event/Result/ResultTypeArrayAware.php b/libraries/src/Event/Result/ResultTypeArrayAware.php index 56e20b63f8de8..b52b04e1443db 100644 --- a/libraries/src/Event/Result/ResultTypeArrayAware.php +++ b/libraries/src/Event/Result/ResultTypeArrayAware.php @@ -64,7 +64,7 @@ public function typeCheckResult($data): void } if (!\is_array($data)) { - throw new \InvalidArgumentException(sprintf('Event %s only accepts Array results.', $this->getName())); + throw new \InvalidArgumentException(\sprintf('Event %s only accepts Array results.', $this->getName())); } } } diff --git a/libraries/src/Event/Result/ResultTypeBooleanAware.php b/libraries/src/Event/Result/ResultTypeBooleanAware.php index 50d68ddf60457..e375b7e925105 100644 --- a/libraries/src/Event/Result/ResultTypeBooleanAware.php +++ b/libraries/src/Event/Result/ResultTypeBooleanAware.php @@ -49,7 +49,7 @@ public function typeCheckResult($data): void } if (!\is_bool($data)) { - throw new \InvalidArgumentException(sprintf('Event %s only accepts Boolean results.', $this->getName())); + throw new \InvalidArgumentException(\sprintf('Event %s only accepts Boolean results.', $this->getName())); } } } diff --git a/libraries/src/Event/Result/ResultTypeFloatAware.php b/libraries/src/Event/Result/ResultTypeFloatAware.php index 44979c9a38a9b..ab5b6f4640204 100644 --- a/libraries/src/Event/Result/ResultTypeFloatAware.php +++ b/libraries/src/Event/Result/ResultTypeFloatAware.php @@ -64,7 +64,7 @@ public function typeCheckResult($data): void } if (!\is_float($data)) { - throw new \InvalidArgumentException(sprintf('Event %s only accepts Float results.', $this->getName())); + throw new \InvalidArgumentException(\sprintf('Event %s only accepts Float results.', $this->getName())); } } } diff --git a/libraries/src/Event/Result/ResultTypeIntegerAware.php b/libraries/src/Event/Result/ResultTypeIntegerAware.php index b5f0e37c0e06e..6524066aa0db2 100644 --- a/libraries/src/Event/Result/ResultTypeIntegerAware.php +++ b/libraries/src/Event/Result/ResultTypeIntegerAware.php @@ -64,7 +64,7 @@ public function typeCheckResult($data): void } if (!\is_int($data)) { - throw new \InvalidArgumentException(sprintf('Event %s only accepts Integer results.', $this->getName())); + throw new \InvalidArgumentException(\sprintf('Event %s only accepts Integer results.', $this->getName())); } } } diff --git a/libraries/src/Event/Result/ResultTypeNumericAware.php b/libraries/src/Event/Result/ResultTypeNumericAware.php index a5304dfb0ae1d..f518069f49f3c 100644 --- a/libraries/src/Event/Result/ResultTypeNumericAware.php +++ b/libraries/src/Event/Result/ResultTypeNumericAware.php @@ -64,7 +64,7 @@ public function typeCheckResult($data): void } if (!is_numeric($data)) { - throw new \InvalidArgumentException(sprintf('Event %s only accepts Numeric results.', $this->getName())); + throw new \InvalidArgumentException(\sprintf('Event %s only accepts Numeric results.', $this->getName())); } } } diff --git a/libraries/src/Event/Result/ResultTypeObjectAware.php b/libraries/src/Event/Result/ResultTypeObjectAware.php index 16f8faba453d3..9fa09be12242f 100644 --- a/libraries/src/Event/Result/ResultTypeObjectAware.php +++ b/libraries/src/Event/Result/ResultTypeObjectAware.php @@ -74,7 +74,7 @@ public function typeCheckResult($data): void } if (!\is_object($data)) { - throw new \InvalidArgumentException(sprintf('Event %s only accepts object results.', $this->getName())); + throw new \InvalidArgumentException(\sprintf('Event %s only accepts object results.', $this->getName())); } if (empty($this->resultAcceptableClasses)) { @@ -89,6 +89,6 @@ public function typeCheckResult($data): void $acceptableTypes = implode(', ', $this->resultAcceptableClasses); $messageTemplate = 'Event %s only accepts object results which are instances of one of %s.'; - throw new \InvalidArgumentException(sprintf($messageTemplate, $this->getName(), $acceptableTypes)); + throw new \InvalidArgumentException(\sprintf($messageTemplate, $this->getName(), $acceptableTypes)); } } diff --git a/libraries/src/Event/Result/ResultTypeStringAware.php b/libraries/src/Event/Result/ResultTypeStringAware.php index 9b1d6a6796f4b..2f5493745c25d 100644 --- a/libraries/src/Event/Result/ResultTypeStringAware.php +++ b/libraries/src/Event/Result/ResultTypeStringAware.php @@ -64,7 +64,7 @@ public function typeCheckResult($data): void } if (!\is_string($data)) { - throw new \InvalidArgumentException(sprintf('Event %s only accepts String results.', $this->getName())); + throw new \InvalidArgumentException(\sprintf('Event %s only accepts String results.', $this->getName())); } } } diff --git a/libraries/src/Event/User/AbstractLoginEvent.php b/libraries/src/Event/User/AbstractLoginEvent.php index a568c170f7e49..799be7a5c712d 100644 --- a/libraries/src/Event/User/AbstractLoginEvent.php +++ b/libraries/src/Event/User/AbstractLoginEvent.php @@ -30,6 +30,33 @@ abstract class AbstractLoginEvent extends UserEvent */ protected $legacyArgumentsOrder = ['subject', 'options']; + /** + * Constructor. + * + * @param string $name The event name. + * @param array $arguments The event arguments. + * + * @throws \BadMethodCallException + * + * @since __DEPLOY_VERSION__ + */ + public function __construct($name, array $arguments = []) + { + if (\count($arguments) === 1) { + // @TODO: Remove in Joomla 7, and set 'options' argument as required. + $missingKey = empty($arguments['subject']) ? 'subject' : 'options'; + + $arguments[key($arguments) === 0 ? 1 : $missingKey] = []; + + @trigger_error( + \sprintf('The event %s requires 2 arguments. Use of 1 argument will throw an exception in Joomla 7.', $this->getName()), + E_USER_DEPRECATED + ); + } + + parent::__construct($name, $arguments); + } + /** * Setter for the subject argument. * diff --git a/libraries/src/Event/User/AbstractLogoutEvent.php b/libraries/src/Event/User/AbstractLogoutEvent.php index febab2b2cdfa1..3c4c36783b12f 100644 --- a/libraries/src/Event/User/AbstractLogoutEvent.php +++ b/libraries/src/Event/User/AbstractLogoutEvent.php @@ -30,6 +30,33 @@ abstract class AbstractLogoutEvent extends UserEvent */ protected $legacyArgumentsOrder = ['subject', 'options']; + /** + * Constructor. + * + * @param string $name The event name. + * @param array $arguments The event arguments. + * + * @throws \BadMethodCallException + * + * @since __DEPLOY_VERSION__ + */ + public function __construct($name, array $arguments = []) + { + if (\count($arguments) === 1) { + // @TODO: Remove in Joomla 7, and set 'options' argument as required. + $missingKey = empty($arguments['subject']) ? 'subject' : 'options'; + + $arguments[key($arguments) === 0 ? 1 : $missingKey] = []; + + @trigger_error( + \sprintf('The event %s requires 2 arguments. Use of 1 argument will throw an exception in Joomla 7.', $this->getName()), + E_USER_DEPRECATED + ); + } + + parent::__construct($name, $arguments); + } + /** * Setter for the subject argument. * diff --git a/libraries/src/Event/User/AuthorisationEvent.php b/libraries/src/Event/User/AuthorisationEvent.php index 2fbece50dc74d..d5f6c143a8fad 100644 --- a/libraries/src/Event/User/AuthorisationEvent.php +++ b/libraries/src/Event/User/AuthorisationEvent.php @@ -80,7 +80,7 @@ protected function onSetOptions(array $value): array public function typeCheckResult($data): void { if (!$data instanceof AuthenticationResponse) { - throw new \InvalidArgumentException(sprintf('Event %s only accepts AuthenticationResponse results.', $this->getName())); + throw new \InvalidArgumentException(\sprintf('Event %s only accepts AuthenticationResponse results.', $this->getName())); } } diff --git a/libraries/src/Exception/ExceptionHandler.php b/libraries/src/Exception/ExceptionHandler.php index f3e09e99514f2..c8816c941511e 100644 --- a/libraries/src/Exception/ExceptionHandler.php +++ b/libraries/src/Exception/ExceptionHandler.php @@ -216,7 +216,7 @@ protected static function logException(\Throwable $error) // Try to log the error, but don't let the logging cause a fatal error try { Log::add( - sprintf( + \sprintf( 'Uncaught Throwable of type %1$s thrown with message "%2$s". Stack trace: %3$s', \get_class($error), $error->getMessage(), diff --git a/libraries/src/Extension/ExtensionHelper.php b/libraries/src/Extension/ExtensionHelper.php index d7f555d039b3a..f17b506296849 100644 --- a/libraries/src/Extension/ExtensionHelper.php +++ b/libraries/src/Extension/ExtensionHelper.php @@ -463,12 +463,12 @@ public static function checkIfCoreExtension($type, $element, $clientId = 0, $fol public static function getExtensionRecord(string $element, string $type, ?int $clientId = null, ?string $folder = null): ?\stdClass { if ($type === 'plugin' && $folder === null) { - throw new \InvalidArgumentException(sprintf('`$folder` is required when `$type` is `plugin` in %s()', __METHOD__)); + throw new \InvalidArgumentException(\sprintf('`$folder` is required when `$type` is `plugin` in %s()', __METHOD__)); } if (\in_array($type, ['module', 'language', 'template'], true) && $clientId === null) { throw new \InvalidArgumentException( - sprintf('`$clientId` is required when `$type` is `module`, `language` or `template` in %s()', __METHOD__) + \sprintf('`$clientId` is required when `$type` is `module`, `language` or `template` in %s()', __METHOD__) ); } diff --git a/libraries/src/Factory.php b/libraries/src/Factory.php index fba5557f9d0de..76a6ff1fc1084 100644 --- a/libraries/src/Factory.php +++ b/libraries/src/Factory.php @@ -178,12 +178,12 @@ public static function getApplication() * @deprecated 4.3 will be removed in 6.0 * Use the configuration object within the application * Example: - * Factory::getApplication->getConfig(); + * Factory::getApplication()->getConfig(); */ public static function getConfig($file = null, $type = 'PHP', $namespace = '') { @trigger_error( - sprintf( + \sprintf( '%s() is deprecated. The configuration object should be read from the application.', __METHOD__ ), @@ -264,7 +264,7 @@ public static function getContainer(): Container public static function getSession(array $options = []) { @trigger_error( - sprintf( + \sprintf( '%1$s() is deprecated. Load the session from the dependency injection container or via %2$s::getApplication()->getSession().', __METHOD__, __CLASS__ @@ -293,7 +293,7 @@ public static function getSession(array $options = []) public static function getLanguage() { @trigger_error( - sprintf( + \sprintf( '%1$s() is deprecated. Load the language from the dependency injection container or via %2$s::getApplication()->getLanguage().', __METHOD__, __CLASS__ @@ -326,7 +326,7 @@ public static function getLanguage() public static function getDocument() { @trigger_error( - sprintf( + \sprintf( '%1$s() is deprecated. Load the document from the dependency injection container or via %2$s::getApplication()->getDocument().', __METHOD__, __CLASS__ @@ -361,7 +361,7 @@ public static function getDocument() public static function getUser($id = null) { @trigger_error( - sprintf( + \sprintf( '%1$s() is deprecated. Load the user from the dependency injection container or via %2$s::getApplication()->getIdentity().', __METHOD__, __CLASS__ @@ -405,7 +405,7 @@ public static function getUser($id = null) public static function getCache($group = '', $handler = 'callback', $storage = null) { @trigger_error( - sprintf( + \sprintf( '%s() is deprecated. The cache controller should be fetched from the factory.', __METHOD__ ), @@ -451,7 +451,7 @@ public static function getCache($group = '', $handler = 'callback', $storage = n public static function getDbo() { @trigger_error( - sprintf( + \sprintf( '%1$s() is deprecated. Load the database from the dependency injection container.', __METHOD__ ), @@ -556,12 +556,12 @@ public static function getDate($time = 'now', $tzOffset = null) * * @deprecated 4.0 will be removed in 6.0 * Use the configuration object within the application. - * Example: Factory::getApplication->getConfig(); + * Example: Factory::getApplication()->getConfig(); */ protected static function createConfig($file, $type = 'PHP', $namespace = '') { @trigger_error( - sprintf( + \sprintf( '%s() is deprecated. The configuration object should be read from the application.', __METHOD__ ), @@ -646,7 +646,7 @@ protected static function createContainer(): Container protected static function createDbo() { @trigger_error( - sprintf( + \sprintf( '%1$s() is deprecated, register a service provider to create a %2$s instance instead.', __METHOD__, DatabaseInterface::class @@ -731,7 +731,7 @@ protected static function createMailer() protected static function createLanguage() { @trigger_error( - sprintf( + \sprintf( '%1$s() is deprecated. Load the language from the dependency injection container or via %2$s::getApplication()->getLanguage().', __METHOD__, __CLASS__ @@ -762,7 +762,7 @@ protected static function createLanguage() protected static function createDocument() { @trigger_error( - sprintf( + \sprintf( '%1$s() is deprecated. Load the document from the dependency injection container or via %2$s::getApplication()->getDocument().', __METHOD__, __CLASS__ diff --git a/libraries/src/Feed/Feed.php b/libraries/src/Feed/Feed.php index f249fa6151f36..b256bcda7d44d 100644 --- a/libraries/src/Feed/Feed.php +++ b/libraries/src/Feed/Feed.php @@ -87,7 +87,7 @@ public function __set($name, $value) // Validate that any authors that are set are instances of JFeedPerson or null. if (($name === 'author') && (!($value instanceof FeedPerson) || ($value === null))) { throw new \InvalidArgumentException( - sprintf( + \sprintf( '%1$s "author" must be an instance of Joomla\\CMS\\Feed\\FeedPerson. %2$s given.', \get_class($this), \is_object($value) ? \get_class($value) : \gettype($value) @@ -98,7 +98,7 @@ public function __set($name, $value) // Disallow setting categories or contributors directly. if (\in_array($name, ['categories', 'contributors'])) { throw new \InvalidArgumentException( - sprintf( + \sprintf( 'Cannot directly set %1$s property "%2$s".', \get_class($this), $name @@ -239,7 +239,7 @@ public function offsetSet($offset, $value): void { if (!($value instanceof FeedEntry)) { throw new \InvalidArgumentException( - sprintf( + \sprintf( '%1$s entries must be an instance of Joomla\\CMS\\Feed\\FeedPerson. %2$s given.', \get_class($this), \is_object($value) ? \get_class($value) : \gettype($value) diff --git a/libraries/src/Feed/FeedEntry.php b/libraries/src/Feed/FeedEntry.php index ecb8998072c6b..7f9f7bb1f6261 100644 --- a/libraries/src/Feed/FeedEntry.php +++ b/libraries/src/Feed/FeedEntry.php @@ -82,7 +82,7 @@ public function __set($name, $value) // Validate that any authors that are set are instances of JFeedPerson or null. if (($name === 'author') && (!($value instanceof FeedPerson) || ($value === null))) { throw new \InvalidArgumentException( - sprintf( + \sprintf( '%1$s "author" must be an instance of Joomla\\CMS\\Feed\\FeedPerson. %2$s given.', \get_class($this), \is_object($value) ? \get_class($value) : \gettype($value) @@ -93,7 +93,7 @@ public function __set($name, $value) // Validate that any sources that are set are instances of JFeed or null. if (($name === 'source') && (!($value instanceof Feed) || ($value === null))) { throw new \InvalidArgumentException( - sprintf( + \sprintf( '%1$s "source" must be an instance of Joomla\\CMS\\Feed\\Feed. %2$s given.', \get_class($this), \is_object($value) ? \get_class($value) : \gettype($value) @@ -104,7 +104,7 @@ public function __set($name, $value) // Disallow setting categories, contributors, or links directly. if (\in_array($name, ['categories', 'contributors', 'links'])) { throw new \InvalidArgumentException( - sprintf( + \sprintf( 'Cannot directly set %1$s property "%2$s".', \get_class($this), $name diff --git a/libraries/src/Filesystem/Folder.php b/libraries/src/Filesystem/Folder.php index 73a27b5da87d0..49d5af0d08ae9 100644 --- a/libraries/src/Filesystem/Folder.php +++ b/libraries/src/Filesystem/Folder.php @@ -136,7 +136,7 @@ public static function copy($src, $dest, $path = '', $force = false, $useStreams if (!$stream->copy($sfid, $dfid)) { throw new \RuntimeException( - sprintf( + \sprintf( "Cannot copy file: %s", Path::removeRoot($stream->getError()) ), diff --git a/libraries/src/Form/Field/CalendarField.php b/libraries/src/Form/Field/CalendarField.php index fb820f2d5e663..0c72d801cfa23 100644 --- a/libraries/src/Form/Field/CalendarField.php +++ b/libraries/src/Form/Field/CalendarField.php @@ -393,7 +393,7 @@ public function filter($value, $group = null, ?Registry $input = null) { // Make sure there is a valid SimpleXMLElement. if (!($this->element instanceof \SimpleXMLElement)) { - throw new \UnexpectedValueException(sprintf('%s::filter `element` is not an instance of SimpleXMLElement', \get_class($this))); + throw new \UnexpectedValueException(\sprintf('%s::filter `element` is not an instance of SimpleXMLElement', \get_class($this))); } if ((int) $value <= 0) { diff --git a/libraries/src/Form/Field/CheckboxesField.php b/libraries/src/Form/Field/CheckboxesField.php index ee904ac49271c..dfe3fc2c5a2b1 100644 --- a/libraries/src/Form/Field/CheckboxesField.php +++ b/libraries/src/Form/Field/CheckboxesField.php @@ -107,7 +107,7 @@ public function __set($name, $value) protected function getInput() { if (empty($this->layout)) { - throw new \UnexpectedValueException(sprintf('%s has no layout assigned.', $this->name)); + throw new \UnexpectedValueException(\sprintf('%s has no layout assigned.', $this->name)); } return $this->getRenderer($this->layout)->render($this->collectLayoutData()); diff --git a/libraries/src/Form/Field/ComboField.php b/libraries/src/Form/Field/ComboField.php index 24d57b55e261a..8651db16fb251 100644 --- a/libraries/src/Form/Field/ComboField.php +++ b/libraries/src/Form/Field/ComboField.php @@ -47,7 +47,7 @@ class ComboField extends ListField protected function getInput() { if (empty($this->layout)) { - throw new \UnexpectedValueException(sprintf('%s has no layout assigned.', $this->name)); + throw new \UnexpectedValueException(\sprintf('%s has no layout assigned.', $this->name)); } return $this->getRenderer($this->layout)->render($this->collectLayoutData()); diff --git a/libraries/src/Form/Field/ContenthistoryField.php b/libraries/src/Form/Field/ContenthistoryField.php index 68f192f12159b..ee96e8933bd94 100644 --- a/libraries/src/Form/Field/ContenthistoryField.php +++ b/libraries/src/Form/Field/ContenthistoryField.php @@ -74,7 +74,7 @@ public function getLayoutData() protected function getInput() { if (empty($this->layout)) { - throw new \UnexpectedValueException(sprintf('%s has no layout assigned.', $this->name)); + throw new \UnexpectedValueException(\sprintf('%s has no layout assigned.', $this->name)); } return $this->getRenderer($this->layout)->render($this->collectLayoutData()); diff --git a/libraries/src/Form/Field/GroupedlistField.php b/libraries/src/Form/Field/GroupedlistField.php index 79d79014d87b0..9cf88ba6e76f8 100644 --- a/libraries/src/Form/Field/GroupedlistField.php +++ b/libraries/src/Form/Field/GroupedlistField.php @@ -138,7 +138,7 @@ protected function getGroups() default: // Unknown element type. - throw new \UnexpectedValueException(sprintf('Unsupported element %s in GroupedlistField', $element->getName()), 500); + throw new \UnexpectedValueException(\sprintf('Unsupported element %s in GroupedlistField', $element->getName()), 500); } } diff --git a/libraries/src/Form/Field/MediaField.php b/libraries/src/Form/Field/MediaField.php index b4cd1ad5842b8..73004903c7b6f 100644 --- a/libraries/src/Form/Field/MediaField.php +++ b/libraries/src/Form/Field/MediaField.php @@ -251,7 +251,7 @@ public function setup(\SimpleXMLElement $element, $value, $group = null) protected function getInput() { if (empty($this->layout)) { - throw new \UnexpectedValueException(sprintf('%s has no layout assigned.', $this->name)); + throw new \UnexpectedValueException(\sprintf('%s has no layout assigned.', $this->name)); } return $this->getRenderer($this->layout)->render($this->collectLayoutData()); diff --git a/libraries/src/Form/Field/ModalSelectField.php b/libraries/src/Form/Field/ModalSelectField.php index e6e71dec4c4df..8a56938b6001a 100644 --- a/libraries/src/Form/Field/ModalSelectField.php +++ b/libraries/src/Form/Field/ModalSelectField.php @@ -247,7 +247,7 @@ public function __set($name, $value) protected function getInput() { if (empty($this->layout)) { - throw new \UnexpectedValueException(sprintf('%s has no layout assigned.', $this->name)); + throw new \UnexpectedValueException(\sprintf('%s has no layout assigned.', $this->name)); } // Get the layout data diff --git a/libraries/src/Form/Field/SubformField.php b/libraries/src/Form/Field/SubformField.php index 828607166aa02..cd2213e647718 100644 --- a/libraries/src/Form/Field/SubformField.php +++ b/libraries/src/Form/Field/SubformField.php @@ -411,7 +411,7 @@ public function filter($value, $group = null, ?Registry $input = null) { // Make sure there is a valid SimpleXMLElement. if (!($this->element instanceof \SimpleXMLElement)) { - throw new \UnexpectedValueException(sprintf('%s::filter `element` is not an instance of SimpleXMLElement', \get_class($this))); + throw new \UnexpectedValueException(\sprintf('%s::filter `element` is not an instance of SimpleXMLElement', \get_class($this))); } // Get the field filter type. diff --git a/libraries/src/Form/Field/UserField.php b/libraries/src/Form/Field/UserField.php index 65c1edc7e20cf..24b187e89867a 100644 --- a/libraries/src/Form/Field/UserField.php +++ b/libraries/src/Form/Field/UserField.php @@ -95,7 +95,7 @@ public function setup(\SimpleXMLElement $element, $value, $group = null) protected function getInput() { if (empty($this->layout)) { - throw new \UnexpectedValueException(sprintf('%s has no layout assigned.', $this->name)); + throw new \UnexpectedValueException(\sprintf('%s has no layout assigned.', $this->name)); } return $this->getRenderer($this->layout)->render($this->collectLayoutData()); diff --git a/libraries/src/Form/Form.php b/libraries/src/Form/Form.php index 391089c5108cf..a411ea97e0bf7 100644 --- a/libraries/src/Form/Form.php +++ b/libraries/src/Form/Form.php @@ -131,7 +131,7 @@ public function bind($data) { // Make sure there is a valid Form XML document. if (!($this->xml instanceof \SimpleXMLElement)) { - throw new \UnexpectedValueException(sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); + throw new \UnexpectedValueException(\sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); } // The data must be an object or array. @@ -208,7 +208,7 @@ public function getField($name, $group = null, $value = null) { // Make sure there is a valid Form XML document. if (!($this->xml instanceof \SimpleXMLElement)) { - throw new \UnexpectedValueException(sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); + throw new \UnexpectedValueException(\sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); } // Attempt to find the field by name and group. @@ -240,7 +240,7 @@ public function getFieldAttribute($name, $attribute, $default = null, $group = n { // Make sure there is a valid Form XML document. if (!($this->xml instanceof \SimpleXMLElement)) { - throw new \UnexpectedValueException(sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); + throw new \UnexpectedValueException(\sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); } // Find the form field element from the definition. @@ -314,7 +314,7 @@ public function getFieldsets($group = null) // Make sure there is a valid Form XML document. if (!($this->xml instanceof \SimpleXMLElement)) { - throw new \UnexpectedValueException(sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); + throw new \UnexpectedValueException(\sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); } if ($group) { @@ -711,7 +711,7 @@ public function removeField($name, $group = null) { // Make sure there is a valid Form XML document. if (!($this->xml instanceof \SimpleXMLElement)) { - throw new \UnexpectedValueException(sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); + throw new \UnexpectedValueException(\sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); } // Find the form field element from the definition. @@ -742,7 +742,7 @@ public function removeGroup($group) { // Make sure there is a valid Form XML document. if (!($this->xml instanceof \SimpleXMLElement)) { - throw new \UnexpectedValueException(sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); + throw new \UnexpectedValueException(\sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); } // Get the fields elements for a given group. @@ -797,7 +797,7 @@ public function setField(\SimpleXMLElement $element, $group = null, $replace = t { // Make sure there is a valid Form XML document. if (!($this->xml instanceof \SimpleXMLElement)) { - throw new \UnexpectedValueException(sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); + throw new \UnexpectedValueException(\sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); } // Find the form field element from the definition. @@ -883,7 +883,7 @@ public function setFieldAttribute($name, $attribute, $value, $group = null) { // Make sure there is a valid Form XML document. if (!($this->xml instanceof \SimpleXMLElement)) { - throw new \UnexpectedValueException(sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); + throw new \UnexpectedValueException(\sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); } // Find the form field element from the definition. @@ -922,13 +922,13 @@ public function setFields(&$elements, $group = null, $replace = true, $fieldset { // Make sure there is a valid Form XML document. if (!($this->xml instanceof \SimpleXMLElement)) { - throw new \UnexpectedValueException(sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); + throw new \UnexpectedValueException(\sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); } // Make sure the elements to set are valid. foreach ($elements as $element) { if (!($element instanceof \SimpleXMLElement)) { - throw new \UnexpectedValueException(sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); + throw new \UnexpectedValueException(\sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); } } @@ -1013,7 +1013,7 @@ public function filter($data, $group = null) { // Make sure there is a valid Form XML document. if (!($this->xml instanceof \SimpleXMLElement)) { - throw new \UnexpectedValueException(sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); + throw new \UnexpectedValueException(\sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); } $input = new Registry($data); @@ -1070,7 +1070,7 @@ public function validate($data, $group = null) { // Make sure there is a valid Form XML document. if (!($this->xml instanceof \SimpleXMLElement)) { - throw new \UnexpectedValueException(sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); + throw new \UnexpectedValueException(\sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); } $return = true; @@ -1156,7 +1156,7 @@ public function postProcess($data, $group = null) { // Make sure there is a valid SimpleXMLElement if (!($this->xml instanceof \SimpleXMLElement)) { - throw new \UnexpectedValueException(sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); + throw new \UnexpectedValueException(\sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); } $input = new Registry($data); @@ -1208,7 +1208,7 @@ protected function findField($name, $group = null) // Make sure there is a valid Form XML document. if (!($this->xml instanceof \SimpleXMLElement)) { - throw new \UnexpectedValueException(sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); + throw new \UnexpectedValueException(\sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); } // Let's get the appropriate field element based on the method arguments. @@ -1281,7 +1281,7 @@ protected function &findFieldsByFieldset($name) { // Make sure there is a valid Form XML document. if (!($this->xml instanceof \SimpleXMLElement)) { - throw new \UnexpectedValueException(sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); + throw new \UnexpectedValueException(\sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); } /* @@ -1313,7 +1313,7 @@ protected function &findFieldsByGroup($group = null, $nested = false) // Make sure there is a valid Form XML document. if (!($this->xml instanceof \SimpleXMLElement)) { - throw new \UnexpectedValueException(sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); + throw new \UnexpectedValueException(\sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); } // Get only fields in a specific group? @@ -1372,7 +1372,7 @@ protected function &findGroup($group) // Make sure there is a valid Form XML document. if (!($this->xml instanceof \SimpleXMLElement)) { - throw new \UnexpectedValueException(sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); + throw new \UnexpectedValueException(\sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); } // Make sure there is actually a group to find. @@ -1442,7 +1442,7 @@ protected function loadField($element, $group = null, $value = null) { // Make sure there is a valid SimpleXMLElement. if (!($element instanceof \SimpleXMLElement)) { - throw new \UnexpectedValueException(sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); + throw new \UnexpectedValueException(\sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); } // Get the field type. @@ -1455,7 +1455,7 @@ protected function loadField($element, $group = null, $value = null) try { $field->setDatabase($this->getDatabase()); } catch (DatabaseNotFoundException $e) { - @trigger_error(sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED); + @trigger_error(\sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED); $field->setDatabase(Factory::getContainer()->get(DatabaseInterface::class)); } } @@ -1515,7 +1515,7 @@ protected function syncPaths() { // Make sure there is a valid Form XML document. if (!($this->xml instanceof \SimpleXMLElement)) { - throw new \UnexpectedValueException(sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); + throw new \UnexpectedValueException(\sprintf('%s::%s `xml` is not an instance of SimpleXMLElement', \get_class($this), __METHOD__)); } // Get any addfieldpath attributes from the form definition. @@ -1687,7 +1687,7 @@ public static function getInstance($name, $data = null, $options = [], $replace $data = trim($data); if (empty($data)) { - throw new \InvalidArgumentException(sprintf('%1$s(%2$s, *%3$s*)', __METHOD__, $name, \gettype($data))); + throw new \InvalidArgumentException(\sprintf('%1$s(%2$s, *%3$s*)', __METHOD__, $name, \gettype($data))); } // Instantiate the form. @@ -1696,11 +1696,11 @@ public static function getInstance($name, $data = null, $options = [], $replace // Load the data. if (substr($data, 0, 1) === '<') { if ($forms[$name]->load($data, $replace, $xpath) == false) { - throw new \RuntimeException(sprintf('%s() could not load form', __METHOD__)); + throw new \RuntimeException(\sprintf('%s() could not load form', __METHOD__)); } } else { if ($forms[$name]->loadFile($data, $replace, $xpath) == false) { - throw new \RuntimeException(sprintf('%s() could not load file', __METHOD__)); + throw new \RuntimeException(\sprintf('%s() could not load file', __METHOD__)); } } } diff --git a/libraries/src/Form/FormField.php b/libraries/src/Form/FormField.php index c307df956279f..c0c0c9274662f 100644 --- a/libraries/src/Form/FormField.php +++ b/libraries/src/Form/FormField.php @@ -776,7 +776,7 @@ protected function getId($fieldId, $fieldName) protected function getInput() { if (empty($this->layout)) { - throw new \UnexpectedValueException(sprintf('%s has no layout assigned.', $this->name)); + throw new \UnexpectedValueException(\sprintf('%s has no layout assigned.', $this->name)); } return $this->getRenderer($this->layout)->render($this->collectLayoutData()); @@ -1080,7 +1080,7 @@ public function filter($value, $group = null, ?Registry $input = null) { // Make sure there is a valid SimpleXMLElement. if (!($this->element instanceof \SimpleXMLElement)) { - throw new \UnexpectedValueException(sprintf('%s::filter `element` is not an instance of SimpleXMLElement', \get_class($this))); + throw new \UnexpectedValueException(\sprintf('%s::filter `element` is not an instance of SimpleXMLElement', \get_class($this))); } // Get the field filter type. @@ -1103,7 +1103,7 @@ public function filter($value, $group = null, ?Registry $input = null) [$class, $method] = explode('::', $filter); if ($class === 'JComponentHelper') { throw new \UnexpectedValueException( - sprintf( + \sprintf( '%s::filter field `%s` calls a deprecated filter class %s, the class needs to be namespaced use %s instead or activate the backward compatible plugin.', \get_class($this), $this->element['name'], @@ -1176,7 +1176,7 @@ public function validate($value, $group = null, ?Registry $input = null) { // Make sure there is a valid SimpleXMLElement. if (!($this->element instanceof \SimpleXMLElement)) { - throw new \UnexpectedValueException(sprintf('%s::validate `element` is not an instance of SimpleXMLElement', \get_class($this))); + throw new \UnexpectedValueException(\sprintf('%s::validate `element` is not an instance of SimpleXMLElement', \get_class($this))); } $valid = true; @@ -1211,14 +1211,14 @@ public function validate($value, $group = null, ?Registry $input = null) // If the object could not be loaded return an error message. if ($rule === false) { - throw new \UnexpectedValueException(sprintf('%s::validate() rule `%s` missing.', \get_class($this), $type)); + throw new \UnexpectedValueException(\sprintf('%s::validate() rule `%s` missing.', \get_class($this), $type)); } if ($rule instanceof DatabaseAwareInterface) { try { $rule->setDatabase($this->getDatabase()); } catch (DatabaseNotFoundException $e) { - @trigger_error(sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED); + @trigger_error(\sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED); $rule->setDatabase(Factory::getContainer()->get(DatabaseInterface::class)); } } @@ -1243,7 +1243,7 @@ public function validate($value, $group = null, ?Registry $input = null) try { $rule->setDatabase($this->getDatabase()); } catch (DatabaseNotFoundException $e) { - @trigger_error(sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED); + @trigger_error(\sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED); $rule->setDatabase(Factory::getContainer()->get(DatabaseInterface::class)); } } diff --git a/libraries/src/Form/FormHelper.php b/libraries/src/Form/FormHelper.php index f86c3b6a76661..602745aaaecaf 100644 --- a/libraries/src/Form/FormHelper.php +++ b/libraries/src/Form/FormHelper.php @@ -244,9 +244,9 @@ protected static function loadClass($entity, $type) // If the type is complex, add the base type to the paths. if ($pos = strpos($type, '_')) { // Add the complex type prefix to the paths. - for ($i = 0, $n = \count($paths); $i < $n; $i++) { + foreach ($paths as $value) { // Derive the new path. - $path = $paths[$i] . '/' . strtolower(substr($type, 0, $pos)); + $path = $value . '/' . strtolower(substr($type, 0, $pos)); // If the path does not exist, add it. if (!\in_array($path, $paths)) { @@ -525,7 +525,7 @@ public static function parseShowOnConditions($showOn, $formControl = null, $grou $field = $formControl . ('[' . str_replace('.', '][', $showOnPartBlocks[0]) . ']'); } else { $groupParts = explode('.', $showOnPartBlocks[0]); - $field = array_shift($groupParts) . '[' . join('][', $groupParts) . ']'; + $field = array_shift($groupParts) . '[' . implode('][', $groupParts) . ']'; } } } diff --git a/libraries/src/Form/FormRule.php b/libraries/src/Form/FormRule.php index 922aa70aa9b77..2fe8c5c7c1b2f 100644 --- a/libraries/src/Form/FormRule.php +++ b/libraries/src/Form/FormRule.php @@ -73,7 +73,7 @@ public function test(\SimpleXMLElement $element, $value, $group = null, ?Registr { // Check for a valid regex. if (empty($this->regex)) { - throw new \UnexpectedValueException(sprintf('%s has invalid regex.', \get_class($this))); + throw new \UnexpectedValueException(\sprintf('%s has invalid regex.', \get_class($this))); } // Detect if we have full UTF-8 and unicode PCRE support. diff --git a/libraries/src/Form/Rule/EqualsRule.php b/libraries/src/Form/Rule/EqualsRule.php index a2fc1123accbb..e7fb6d3deff34 100644 --- a/libraries/src/Form/Rule/EqualsRule.php +++ b/libraries/src/Form/Rule/EqualsRule.php @@ -49,15 +49,15 @@ public function test(\SimpleXMLElement $element, $value, $group = null, ?Registr // Check that a validation field is set. if (!$field) { - throw new \UnexpectedValueException(sprintf('$field empty in %s::test', \get_class($this))); + throw new \UnexpectedValueException(\sprintf('$field empty in %s::test', \get_class($this))); } if (\is_null($form)) { - throw new \InvalidArgumentException(sprintf('The value for $form must not be null in %s', \get_class($this))); + throw new \InvalidArgumentException(\sprintf('The value for $form must not be null in %s', \get_class($this))); } if (\is_null($input)) { - throw new \InvalidArgumentException(sprintf('The value for $input must not be null in %s', \get_class($this))); + throw new \InvalidArgumentException(\sprintf('The value for $input must not be null in %s', \get_class($this))); } $test = $input->get($field); diff --git a/libraries/src/Form/Rule/NotequalsRule.php b/libraries/src/Form/Rule/NotequalsRule.php index eb9e8d24cd035..ab7d520ff7fda 100644 --- a/libraries/src/Form/Rule/NotequalsRule.php +++ b/libraries/src/Form/Rule/NotequalsRule.php @@ -49,11 +49,11 @@ public function test(\SimpleXMLElement $element, $value, $group = null, ?Registr // Check that a validation field is set. if (!$field) { - throw new \UnexpectedValueException(sprintf('$field empty in %s::test', \get_class($this))); + throw new \UnexpectedValueException(\sprintf('$field empty in %s::test', \get_class($this))); } if ($input === null) { - throw new \InvalidArgumentException(sprintf('The value for $input must not be null in %s', \get_class($this))); + throw new \InvalidArgumentException(\sprintf('The value for $input must not be null in %s', \get_class($this))); } // Test the two values against each other. diff --git a/libraries/src/Form/Rule/RulesRule.php b/libraries/src/Form/Rule/RulesRule.php index 5e8ff4a61d931..764b1a39069ce 100644 --- a/libraries/src/Form/Rule/RulesRule.php +++ b/libraries/src/Form/Rule/RulesRule.php @@ -43,8 +43,8 @@ class RulesRule extends FormRule public function test(\SimpleXMLElement $element, $value, $group = null, ?Registry $input = null, ?Form $form = null) { // Get the possible field actions and the ones posted to validate them. - $fieldActions = self::getFieldActions($element); - $valueActions = self::getValueActions($value); + $fieldActions = $this->getFieldActions($element); + $valueActions = $this->getValueActions($value); // Make sure that all posted actions are in the list of possible actions for the field. foreach ($valueActions as $action) { diff --git a/libraries/src/Form/Rule/SubformRule.php b/libraries/src/Form/Rule/SubformRule.php index 07d167c919cae..b34f40beab2cc 100644 --- a/libraries/src/Form/Rule/SubformRule.php +++ b/libraries/src/Form/Rule/SubformRule.php @@ -46,7 +46,7 @@ public function test(\SimpleXMLElement $element, $value, $group = null, ?Registr $field = $form->getField($element['name'], $group); if (!($field instanceof SubformField)) { - throw new \UnexpectedValueException(sprintf('%s is no subform field.', $element['name'])); + throw new \UnexpectedValueException(\sprintf('%s is no subform field.', $element['name'])); } if ($value === null) { diff --git a/libraries/src/HTML/HTMLHelper.php b/libraries/src/HTML/HTMLHelper.php index dbfe050bdfb77..aeb74f1266eaf 100644 --- a/libraries/src/HTML/HTMLHelper.php +++ b/libraries/src/HTML/HTMLHelper.php @@ -142,7 +142,7 @@ final public static function _(string $key, ...$methodArgs) $toCall = [$service, $func]; if (!\is_callable($toCall)) { - throw new \InvalidArgumentException(sprintf('%s::%s not found.', $file, $func), 500); + throw new \InvalidArgumentException(\sprintf('%s::%s not found.', $file, $func), 500); } static::register($key, $toCall); @@ -156,14 +156,14 @@ final public static function _(string $key, ...$methodArgs) $path = Path::find(static::$includePaths, strtolower($file) . '.php'); if (!$path) { - throw new \InvalidArgumentException(sprintf('%s %s not found.', $prefix, $file), 500); + throw new \InvalidArgumentException(\sprintf('%s %s not found.', $prefix, $file), 500); } \JLoader::register($className, $path); if (!class_exists($className)) { if ($prefix !== 'Joomla\\CMS\\HTML\\HTMLHelper') { - throw new \InvalidArgumentException(sprintf('%s not found.', $className), 500); + throw new \InvalidArgumentException(\sprintf('%s not found.', $className), 500); } // @deprecated with 5.0 remove with 6.0 or 7.0 (depends on other relevant code) @@ -172,7 +172,7 @@ final public static function _(string $key, ...$methodArgs) \JLoader::register($className, $path); if (!class_exists($className)) { - throw new \InvalidArgumentException(sprintf('%s not found.', $className), 500); + throw new \InvalidArgumentException(\sprintf('%s not found.', $className), 500); } } } @@ -187,7 +187,7 @@ final public static function _(string $key, ...$methodArgs) $toCall = [$className, $func]; if (!\is_callable($toCall)) { - throw new \InvalidArgumentException(sprintf('%s::%s not found.', $className, $func), 500); + throw new \InvalidArgumentException(\sprintf('%s::%s not found.', $className, $func), 500); } static::register($key, $toCall); diff --git a/libraries/src/HTML/Helpers/Access.php b/libraries/src/HTML/Helpers/Access.php index dd4b2f44f432f..9de65e389c1e3 100644 --- a/libraries/src/HTML/Helpers/Access.php +++ b/libraries/src/HTML/Helpers/Access.php @@ -116,9 +116,9 @@ public static function usergroup($name, $selected, $attribs = '', $allowAll = tr { $options = array_values(UserGroupsHelper::getInstance()->getAll()); - for ($i = 0, $n = \count($options); $i < $n; $i++) { - $options[$i]->value = $options[$i]->id; - $options[$i]->text = str_repeat('- ', $options[$i]->level) . $options[$i]->title; + foreach ($options as $option) { + $option->value = $option->id; + $option->text = str_repeat('- ', $option->level) . $option->title; } // If all usergroups is allowed, push it into the array. @@ -152,9 +152,7 @@ public static function usergroups($name, $selected, $checkSuperAdmin = false) $html = []; - for ($i = 0, $n = \count($groups); $i < $n; $i++) { - $item = &$groups[$i]; - + foreach ($groups as $item) { // If checkSuperAdmin is true, only add item if the user is superadmin or the group is not super admin if ((!$checkSuperAdmin) || $isSuperAdmin || (!AccessCheck::checkGroup($item->id, 'core.admin'))) { // Set up the variable attributes. ID may not start with a number (CSS) @@ -212,9 +210,7 @@ public static function actions($name, $selected, $component, $section = 'global' $html = []; $html[] = '
    '; - for ($i = 0, $n = \count($actions); $i < $n; $i++) { - $item = &$actions[$i]; - + foreach ($actions as $item) { // Setup the variable attributes. $eid = $count . 'action_' . $item->id; $checked = \in_array($item->id, $selected) ? ' checked="checked"' : ''; diff --git a/libraries/src/HTML/Helpers/Select.php b/libraries/src/HTML/Helpers/Select.php index 7a1b20abc293a..476e976c2818f 100644 --- a/libraries/src/HTML/Helpers/Select.php +++ b/libraries/src/HTML/Helpers/Select.php @@ -321,7 +321,7 @@ public static function integerlist($start, $end, $inc, $name, $attribs = null, $ $data = []; for ($i = $start; $i <= $end; $i += $inc) { - $data[$i] = $format ? sprintf($format, $i) : $i; + $data[$i] = $format ? \sprintf($format, $i) : $i; } // Tell genericlist() to use array keys diff --git a/libraries/src/HTML/Helpers/StringHelper.php b/libraries/src/HTML/Helpers/StringHelper.php index 40db6bf243703..099a9f9b49105 100644 --- a/libraries/src/HTML/Helpers/StringHelper.php +++ b/libraries/src/HTML/Helpers/StringHelper.php @@ -101,19 +101,17 @@ public static function truncate($text, $length = 0, $noSplit = true, $allowHtml preg_match_all("#]*?)>#iU", $tmp, $result); $closedTags = $result[1]; - $numOpened = \count($openedTags); - // Not all tags are closed so trim the text and finish. - if (\count($closedTags) !== $numOpened) { + if (\count($closedTags) !== \count($openedTags)) { // Closing tags need to be in the reverse order of opening tags. $openedTags = array_reverse($openedTags); // Close tags - for ($i = 0; $i < $numOpened; $i++) { - if (!\in_array($openedTags[$i], $closedTags)) { - $tmp .= ''; + foreach ($openedTags as $openedTag) { + if (!\in_array($openedTag, $closedTags)) { + $tmp .= ''; } else { - unset($closedTags[array_search($openedTags[$i], $closedTags)]); + unset($closedTags[array_search($openedTag, $closedTags)]); } } } diff --git a/libraries/src/HTML/Helpers/User.php b/libraries/src/HTML/Helpers/User.php index 00ecb79fb4593..0a7bb53b739b3 100644 --- a/libraries/src/HTML/Helpers/User.php +++ b/libraries/src/HTML/Helpers/User.php @@ -38,10 +38,10 @@ public static function groups($includeSuperAdmin = false) { $options = array_values(UserGroupsHelper::getInstance()->getAll()); - for ($i = 0, $n = \count($options); $i < $n; $i++) { - $options[$i]->value = $options[$i]->id; - $options[$i]->text = str_repeat('- ', $options[$i]->level) . $options[$i]->title; - $groups[] = HTMLHelper::_('select.option', $options[$i]->value, $options[$i]->text); + foreach ($options as $option) { + $option->value = $option->id; + $option->text = str_repeat('- ', $option->level) . $option->title; + $groups[] = HTMLHelper::_('select.option', $option->value, $option->text); } // Exclude super admin groups if requested diff --git a/libraries/src/HTML/Registry.php b/libraries/src/HTML/Registry.php index 3e28893dd4338..2ca78318c3f7c 100644 --- a/libraries/src/HTML/Registry.php +++ b/libraries/src/HTML/Registry.php @@ -120,7 +120,7 @@ public function register(string $key, $handler, bool $replace = false) // Otherwise the handler must be a class object if (!\is_string($handler) && !\is_object($handler)) { throw new \RuntimeException( - sprintf( + \sprintf( 'The handler for service key %1$s must be a PHP class name or class object, a %2$s was given.', $key, \gettype($handler) diff --git a/libraries/src/Helper/ModuleHelper.php b/libraries/src/Helper/ModuleHelper.php index 7ded94f7d26b5..4a92863884e51 100644 --- a/libraries/src/Helper/ModuleHelper.php +++ b/libraries/src/Helper/ModuleHelper.php @@ -41,7 +41,7 @@ abstract class ModuleHelper * @param string $name The name of the module * @param string $title The title of the module, optional * - * @return \stdClass The Module object + * @return \stdClass|null The Module object * * @since 1.5 */ @@ -49,15 +49,14 @@ public static function &getModule($name, $title = null) { $result = null; $modules =& static::load(); - $total = \count($modules); - for ($i = 0; $i < $total; $i++) { + foreach ($modules as $module) { // Match the name of the module - if ($modules[$i]->name === $name || $modules[$i]->module === $name) { + if ($module->name === $name || $module->module === $name) { // Match the title if we're looking for a specific instance of the module - if (!$title || $modules[$i]->title === $title) { + if (!$title || $module->title === $title) { // Found it - $result = &$modules[$i]; + $result = $module; break; } } @@ -87,11 +86,10 @@ public static function &getModules($position) $result = []; $input = Factory::getApplication()->getInput(); $modules = &static::load(); - $total = \count($modules); - for ($i = 0; $i < $total; $i++) { - if ($modules[$i]->position === $position) { - $result[] = &$modules[$i]; + foreach ($modules as $module) { + if ($module->position === $position) { + $result[] = $module; } } @@ -695,13 +693,11 @@ public static function &getModuleById($id) { $modules =& static::load(); - $total = \count($modules); - - for ($i = 0; $i < $total; $i++) { + foreach ($modules as $module) { // Match the id of the module - if ((string) $modules[$i]->id === $id) { + if ((string) $module->id === $id) { // Found it - return $modules[$i]; + return $module; } } diff --git a/libraries/src/Helper/RouteHelper.php b/libraries/src/Helper/RouteHelper.php index 09648931e433d..b63349b08d789 100644 --- a/libraries/src/Helper/RouteHelper.php +++ b/libraries/src/Helper/RouteHelper.php @@ -221,7 +221,7 @@ public static function getCategoryRoute($catid, $language = 0, $extension = '') { // Note: $extension is required but has to be an optional argument in the function call due to argument order if (empty($extension)) { - throw new \InvalidArgumentException(sprintf('$extension is a required argument in %s()', __METHOD__)); + throw new \InvalidArgumentException(\sprintf('$extension is a required argument in %s()', __METHOD__)); } if ($catid instanceof CategoryNode) { diff --git a/libraries/src/Helper/TagsHelper.php b/libraries/src/Helper/TagsHelper.php index cf0cf7ad77f2a..d91f504701035 100644 --- a/libraries/src/Helper/TagsHelper.php +++ b/libraries/src/Helper/TagsHelper.php @@ -109,7 +109,7 @@ public function addTagMapping($ucmId, TableInterface $table, $tags = []) // Insert the new tag maps if (strpos(implode(',', $tags), '#') !== false) { - $tags = self::createTagsFromField($tags); + $tags = $this->createTagsFromField($tags); } // Prevent saving duplicate tags diff --git a/libraries/src/Http/Transport/SocketTransport.php b/libraries/src/Http/Transport/SocketTransport.php index a7e64e766ce0a..45c10da198e7a 100644 --- a/libraries/src/Http/Transport/SocketTransport.php +++ b/libraries/src/Http/Transport/SocketTransport.php @@ -242,7 +242,7 @@ protected function connect(UriInterface $uri, $timeout = null) if (!$connection) { // Error but nothing from php? Create our own if (!$err) { - $err = sprintf('Could not connect to host: %s:%s', $host, $port); + $err = \sprintf('Could not connect to host: %s:%s', $host, $port); } throw new \Exception($err); diff --git a/libraries/src/Http/Transport/StreamTransport.php b/libraries/src/Http/Transport/StreamTransport.php index cb821727cc9e0..320db7b78268c 100644 --- a/libraries/src/Http/Transport/StreamTransport.php +++ b/libraries/src/Http/Transport/StreamTransport.php @@ -154,7 +154,7 @@ public function request($method, UriInterface $uri, $data = null, array $headers if (!$stream) { // Error but nothing from php? Create our own - throw new \Exception(sprintf('Could not connect to resource: %s', $uri)); + throw new \Exception(\sprintf('Could not connect to resource: %s', $uri)); } } catch (\Exception $e) { throw new \RuntimeException($e->getMessage()); diff --git a/libraries/src/Installer/Adapter/ComponentAdapter.php b/libraries/src/Installer/Adapter/ComponentAdapter.php index 4a3fbc7138760..eaa2c5f2a60bc 100644 --- a/libraries/src/Installer/Adapter/ComponentAdapter.php +++ b/libraries/src/Installer/Adapter/ComponentAdapter.php @@ -559,7 +559,7 @@ public function loadLanguage($path = null) default: throw new \InvalidArgumentException( - sprintf( + \sprintf( 'Unsupported client ID %d for component %s', $this->parent->extension->client_id, $this->parent->extension->element diff --git a/libraries/src/Installer/Installer.php b/libraries/src/Installer/Installer.php index b8a240771a998..dcdd10f90699c 100644 --- a/libraries/src/Installer/Installer.php +++ b/libraries/src/Installer/Installer.php @@ -1265,7 +1265,7 @@ public function parseSchemaUpdates(\SimpleXMLElement $schema, $eid) continue; } - $buffer = file_get_contents(sprintf("%s/%s/%s.sql", $this->getPath('extension_root'), $schemapath, $file)); + $buffer = file_get_contents(\sprintf("%s/%s/%s.sql", $this->getPath('extension_root'), $schemapath, $file)); // Graceful exit and rollback if read not successful if ($buffer === false) { @@ -2435,7 +2435,7 @@ public function loadAdapter($adapter, $options = []) } if (!class_exists($class)) { - throw new \InvalidArgumentException(sprintf('The %s install adapter does not exist.', $adapter)); + throw new \InvalidArgumentException(\sprintf('The %s install adapter does not exist.', $adapter)); } // Ensure the adapter type is part of the options array diff --git a/libraries/src/Installer/LegacyInstallerScript.php b/libraries/src/Installer/LegacyInstallerScript.php index 9b017ebde0a01..51a95e46dcf35 100644 --- a/libraries/src/Installer/LegacyInstallerScript.php +++ b/libraries/src/Installer/LegacyInstallerScript.php @@ -180,7 +180,7 @@ private function callOnScript(string $name, array $arguments): bool try { $this->installerScript->setDatabase($this->getDatabase()); } catch (DatabaseNotFoundException $e) { - @trigger_error(sprintf('Database must be set, this will not be caught anymore in 6.0 in %s.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(\sprintf('Database must be set, this will not be caught anymore in 6.0 in %s.', __METHOD__), E_USER_DEPRECATED); $this->installerScript->setDatabase(Factory::getContainer()->get(DatabaseInterface::class)); } } diff --git a/libraries/src/Language/Language.php b/libraries/src/Language/Language.php index 33e03ae72b307..6709047a9cc31 100644 --- a/libraries/src/Language/Language.php +++ b/libraries/src/Language/Language.php @@ -739,7 +739,7 @@ public function debugFile(string $filename): int // Make sure our file actually exists if (!is_file($filename)) { throw new \InvalidArgumentException( - sprintf('Unable to locate file "%s" for debugging', $filename) + \sprintf('Unable to locate file "%s" for debugging', $filename) ); } diff --git a/libraries/src/Language/Text.php b/libraries/src/Language/Text.php index da5c56568875a..90c910e651682 100644 --- a/libraries/src/Language/Text.php +++ b/libraries/src/Language/Text.php @@ -327,7 +327,7 @@ public static function script($string = null, $jsSafe = false, $interpretBackSla { if ($string === null) { @trigger_error( - sprintf( + \sprintf( 'As of 3.7.0, passing a null value for the first argument of %1$s() is deprecated and will not be supported in 4.0.' . ' Use the %2$s::getScriptStrings() method to get the strings from the JavaScript language store instead.', __METHOD__, diff --git a/libraries/src/Log/DelegatingPsrLogger.php b/libraries/src/Log/DelegatingPsrLogger.php index 8a57ffb5a7ade..6512e08b3f3bf 100644 --- a/libraries/src/Log/DelegatingPsrLogger.php +++ b/libraries/src/Log/DelegatingPsrLogger.php @@ -97,6 +97,6 @@ public function log($level, string|\Stringable $message, array $context = []): v $date = $context['date']; } - $this->logger->add((string) $message, $priority, $category, $date, $context); + $this->logger::add((string) $message, $priority, $category, $date, $context); } } diff --git a/libraries/src/Log/Log.php b/libraries/src/Log/Log.php index 69e3d1f47e445..7027dada9e235 100644 --- a/libraries/src/Log/Log.php +++ b/libraries/src/Log/Log.php @@ -329,7 +329,7 @@ protected function addLogEntry(LogEntry $entry) $class = $this->loggerRegistry->getLoggerClass($this->configurations[$signature]['logger']); } else { @trigger_error( - sprintf( + \sprintf( 'Attempting to automatically resolve loggers to the %s namespace is deprecated as of 4.0 and will be removed in 5.0.' . ' Use the logger registry instead.', __NAMESPACE__ diff --git a/libraries/src/Log/Logger/CallbackLogger.php b/libraries/src/Log/Logger/CallbackLogger.php index 20b26b328d6a8..87b6bf7bc27d4 100644 --- a/libraries/src/Log/Logger/CallbackLogger.php +++ b/libraries/src/Log/Logger/CallbackLogger.php @@ -49,7 +49,7 @@ public function __construct(array &$options) // Throw an exception if there is not a valid callback if (!isset($this->options['callback']) || !\is_callable($this->options['callback'])) { - throw new \RuntimeException(sprintf('%s created without valid callback function.', \get_class($this))); + throw new \RuntimeException(\sprintf('%s created without valid callback function.', \get_class($this))); } $this->callback = $this->options['callback']; diff --git a/libraries/src/MVC/Controller/BaseController.php b/libraries/src/MVC/Controller/BaseController.php index 4cb22b9c9ba77..587b0872bacda 100644 --- a/libraries/src/MVC/Controller/BaseController.php +++ b/libraries/src/MVC/Controller/BaseController.php @@ -274,7 +274,7 @@ public static function getInstance($prefix, $config = []) } @trigger_error( - sprintf( + \sprintf( '%1$s::getInstance() is deprecated. Load it through the MVC factory.', self::class ), @@ -445,9 +445,9 @@ public function __construct($config = [], ?MVCFactoryInterface $factory = null, // Set the default model search path if (\array_key_exists('model_path', $config)) { // User-defined dirs - $this->addModelPath($config['model_path'], $this->model_prefix); + static::addModelPath($config['model_path'], $this->model_prefix); } else { - $this->addModelPath($this->basePath . '/models', $this->model_prefix); + static::addModelPath($this->basePath . '/models', $this->model_prefix); } // Set the default view search path @@ -524,7 +524,7 @@ protected function checkEditId($context, $id) { if (!($this->app instanceof CMSWebApplicationInterface)) { throw new \Exception( - sprintf( + \sprintf( 'The %s method requires an instance of %s but instead %s was supplied', __METHOD__, CMSWebApplicationInterface::class, @@ -540,7 +540,7 @@ protected function checkEditId($context, $id) if (\defined('JDEBUG') && JDEBUG) { $this->getLogger()->info( - sprintf( + \sprintf( 'Checking edit ID %s.%s: %d %s', $context, $id, @@ -638,7 +638,7 @@ public function display($cachable = false, $urlparams = []) { if (!($this->app instanceof CMSWebApplicationInterface)) { throw new \Exception( - sprintf( + \sprintf( 'The %s method requires an instance of %s but instead %s was supplied', __METHOD__, CMSWebApplicationInterface::class, @@ -900,7 +900,7 @@ protected function holdEditId($context, $id) { if (!($this->app instanceof CMSWebApplicationInterface)) { throw new \Exception( - sprintf( + \sprintf( 'The %s method requires an instance of %s but instead %s was supplied', __METHOD__, CMSWebApplicationInterface::class, @@ -919,7 +919,7 @@ protected function holdEditId($context, $id) if (\defined('JDEBUG') && JDEBUG) { $this->getLogger()->info( - sprintf( + \sprintf( 'Holding edit ID %s.%s %s', $context, $id, @@ -943,7 +943,7 @@ public function redirect() { if (!($this->app instanceof CMSWebApplicationInterface)) { throw new \Exception( - sprintf( + \sprintf( 'The %s method requires an instance of %s but instead %s was supplied', __METHOD__, CMSWebApplicationInterface::class, @@ -1029,7 +1029,7 @@ protected function releaseEditId($context, $id) { if (!($this->app instanceof CMSWebApplicationInterface)) { throw new \Exception( - sprintf( + \sprintf( 'The %s method requires an instance of %s but instead %s was supplied', __METHOD__, CMSWebApplicationInterface::class, @@ -1049,7 +1049,7 @@ protected function releaseEditId($context, $id) if (\defined('JDEBUG') && JDEBUG) { $this->getLogger()->info( - sprintf( + \sprintf( 'Releasing edit ID %s.%s %s', $context, $id, @@ -1134,7 +1134,7 @@ public function checkToken($method = 'post', $redirect = true) { if (!($this->app instanceof CMSWebApplicationInterface)) { throw new \Exception( - sprintf( + \sprintf( 'The %s method requires an instance of %s but instead %s was supplied', __METHOD__, CMSWebApplicationInterface::class, @@ -1236,7 +1236,7 @@ public function getDispatcher() { if (!$this->dispatcher) { @trigger_error( - sprintf('Dispatcher for %s should be set through MVC factory. It will throw an exception in 6.0', __CLASS__), + \sprintf('Dispatcher for %s should be set through MVC factory. It will throw an exception in 6.0', __CLASS__), E_USER_DEPRECATED ); diff --git a/libraries/src/MVC/Factory/MVCFactory.php b/libraries/src/MVC/Factory/MVCFactory.php index d3f02193c279a..a0282f2b4d69b 100644 --- a/libraries/src/MVC/Factory/MVCFactory.php +++ b/libraries/src/MVC/Factory/MVCFactory.php @@ -143,7 +143,7 @@ public function createModel($name, $prefix = '', array $config = []) if (!$prefix) { @trigger_error( - sprintf( + \sprintf( 'Calling %s() without a prefix is deprecated.', __METHOD__ ), @@ -171,7 +171,7 @@ public function createModel($name, $prefix = '', array $config = []) try { $model->setDatabase($this->getDatabase()); } catch (DatabaseNotFoundException $e) { - @trigger_error(sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED); + @trigger_error(\sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED); $model->setDatabase(Factory::getContainer()->get(DatabaseInterface::class)); } } @@ -201,7 +201,7 @@ public function createView($name, $prefix = '', $type = '', array $config = []) if (!$prefix) { @trigger_error( - sprintf( + \sprintf( 'Calling %s() without a prefix is deprecated.', __METHOD__ ), @@ -247,7 +247,7 @@ public function createTable($name, $prefix = '', array $config = []) if (!$prefix) { @trigger_error( - sprintf( + \sprintf( 'Calling %s() without a prefix is deprecated.', __METHOD__ ), @@ -267,7 +267,7 @@ public function createTable($name, $prefix = '', array $config = []) try { $db = \array_key_exists('dbo', $config) ? $config['dbo'] : $this->getDatabase(); } catch (DatabaseNotFoundException $e) { - @trigger_error(sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED); + @trigger_error(\sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED); $db = Factory::getContainer()->get(DatabaseInterface::class); } diff --git a/libraries/src/MVC/Model/BaseDatabaseModel.php b/libraries/src/MVC/Model/BaseDatabaseModel.php index 82e7778cfe5da..5ac17120cb903 100644 --- a/libraries/src/MVC/Model/BaseDatabaseModel.php +++ b/libraries/src/MVC/Model/BaseDatabaseModel.php @@ -105,7 +105,7 @@ public function __construct($config = [], ?MVCFactoryInterface $factory = null) $db = \array_key_exists('dbo', $config) ? $config['dbo'] : Factory::getDbo(); if ($db) { - @trigger_error(sprintf('Database is not available in constructor in 6.0.'), E_USER_DEPRECATED); + @trigger_error(\sprintf('Database is not available in constructor in 6.0.'), E_USER_DEPRECATED); $this->setDatabase($db); // Is needed, when models use the deprecated MVC DatabaseAwareTrait, as the trait is overriding the local functions @@ -114,10 +114,10 @@ public function __construct($config = [], ?MVCFactoryInterface $factory = null) // Set the default view search path if (\array_key_exists('table_path', $config)) { - $this->addTablePath($config['table_path']); + static::addTablePath($config['table_path']); } elseif (\defined('JPATH_COMPONENT_ADMINISTRATOR')) { - $this->addTablePath(JPATH_COMPONENT_ADMINISTRATOR . '/tables'); - $this->addTablePath(JPATH_COMPONENT_ADMINISTRATOR . '/table'); + static::addTablePath(JPATH_COMPONENT_ADMINISTRATOR . '/tables'); + static::addTablePath(JPATH_COMPONENT_ADMINISTRATOR . '/table'); } // Set the clean cache event @@ -348,7 +348,7 @@ public function getDispatcher() { if (!$this->dispatcher) { @trigger_error( - sprintf('Dispatcher for %s should be set through MVC factory. It will throw an exception in 6.0', __CLASS__), + \sprintf('Dispatcher for %s should be set through MVC factory. It will throw an exception in 6.0', __CLASS__), E_USER_DEPRECATED ); @@ -374,7 +374,7 @@ protected function dispatchEvent(EventInterface $event) $this->getDispatcher()->dispatch($event->getName(), $event); @trigger_error( - sprintf( + \sprintf( 'Method %s is deprecated and will be removed in 6.0. Use getDispatcher()->dispatch() directly.', __METHOD__ ), diff --git a/libraries/src/MVC/Model/LegacyModelLoaderTrait.php b/libraries/src/MVC/Model/LegacyModelLoaderTrait.php index 3e475cb44b4d5..4f120a6be8e3b 100644 --- a/libraries/src/MVC/Model/LegacyModelLoaderTrait.php +++ b/libraries/src/MVC/Model/LegacyModelLoaderTrait.php @@ -62,12 +62,12 @@ protected static function _createFileName($type, $parts = []) * * @deprecated 4.3 will be removed in 6.0 * Will be removed without replacement. Get the model through the MVCFactory instead - * Example: Factory::getApplication->bootComponent('com_xxx')->getMVCFactory()->createModel($type, $prefix, $config); + * Example: Factory::getApplication()->bootComponent('com_xxx')->getMVCFactory()->createModel($type, $prefix, $config); */ public static function getInstance($type, $prefix = '', $config = []) { @trigger_error( - sprintf( + \sprintf( '%1$s::getInstance() is deprecated. Load it through the MVC factory.', self::class ), diff --git a/libraries/src/MVC/Model/State.php b/libraries/src/MVC/Model/State.php index eb26955ab553d..654f4a3669106 100644 --- a/libraries/src/MVC/Model/State.php +++ b/libraries/src/MVC/Model/State.php @@ -54,7 +54,7 @@ public function get($path, $default = null) { if (isset($this->data->$path) && empty($this->data->$path)) { @trigger_error( - sprintf('Instead of an empty value, the default value will be returned in 7.0 in %s::%s.', __METHOD__, __CLASS__), + \sprintf('Instead of an empty value, the default value will be returned in 7.0 in %s::%s.', __METHOD__, __CLASS__), E_USER_DEPRECATED ); return $this->data->$path; @@ -91,7 +91,7 @@ public function getProperties() */ public function __get($name) { - @trigger_error(sprintf('Direct property access will not be supported in 7.0 in %s::%s.', __METHOD__, __CLASS__), E_USER_DEPRECATED); + @trigger_error(\sprintf('Direct property access will not be supported in 7.0 in %s::%s.', __METHOD__, __CLASS__), E_USER_DEPRECATED); return $this->get($name); } @@ -111,7 +111,7 @@ public function __get($name) */ public function __set($name, $value) { - @trigger_error(sprintf('Direct property access will not be supported in 7.0 in %s::%s.', __METHOD__, __CLASS__), E_USER_DEPRECATED); + @trigger_error(\sprintf('Direct property access will not be supported in 7.0 in %s::%s.', __METHOD__, __CLASS__), E_USER_DEPRECATED); return $this->set($name, $value); } @@ -130,7 +130,7 @@ public function __set($name, $value) */ public function __isset($name) { - @trigger_error(sprintf('Direct property access will not be supported in 7.0 in %s::%s.', __METHOD__, __CLASS__), E_USER_DEPRECATED); + @trigger_error(\sprintf('Direct property access will not be supported in 7.0 in %s::%s.', __METHOD__, __CLASS__), E_USER_DEPRECATED); return $this->exists($name); } diff --git a/libraries/src/MVC/View/AbstractView.php b/libraries/src/MVC/View/AbstractView.php index c223f2881eb27..df92ff5094e66 100644 --- a/libraries/src/MVC/View/AbstractView.php +++ b/libraries/src/MVC/View/AbstractView.php @@ -239,7 +239,7 @@ public function getName() } if (empty($this->_name)) { - throw new \Exception(sprintf($this->getLanguage()->_('JLIB_APPLICATION_ERROR_GET_NAME'), __METHOD__), 500); + throw new \Exception(\sprintf($this->getLanguage()->_('JLIB_APPLICATION_ERROR_GET_NAME'), __METHOD__), 500); } } @@ -292,7 +292,7 @@ public function getDispatcher() { if (!$this->dispatcher) { @trigger_error( - sprintf('Dispatcher for %s should be set through MVC factory. It will throw an exception in 6.0', __CLASS__), + \sprintf('Dispatcher for %s should be set through MVC factory. It will throw an exception in 6.0', __CLASS__), E_USER_DEPRECATED ); @@ -318,7 +318,7 @@ protected function dispatchEvent(EventInterface $event) $this->getDispatcher()->dispatch($event->getName(), $event); @trigger_error( - sprintf( + \sprintf( 'Method %s is deprecated and will be removed in 6.0. Use getDispatcher()->dispatch() directly.', __METHOD__ ), diff --git a/libraries/src/MVC/View/CanDo.php b/libraries/src/MVC/View/CanDo.php index 96e1417cbed23..6132d5e8e4dbd 100644 --- a/libraries/src/MVC/View/CanDo.php +++ b/libraries/src/MVC/View/CanDo.php @@ -54,7 +54,7 @@ public function get($path, $default = null) { if (isset($this->data->$path) && empty($this->data->$path)) { @trigger_error( - sprintf('Instead of an empty value, the default value will be returned in 7.0 in %s::%s.', __METHOD__, __CLASS__), + \sprintf('Instead of an empty value, the default value will be returned in 7.0 in %s::%s.', __METHOD__, __CLASS__), E_USER_DEPRECATED ); return $this->data->$path; @@ -91,7 +91,7 @@ public function getProperties() */ public function __get($name) { - @trigger_error(sprintf('Direct property access will not be supported in 7.0 in %s::%s.', __METHOD__, __CLASS__), E_USER_DEPRECATED); + @trigger_error(\sprintf('Direct property access will not be supported in 7.0 in %s::%s.', __METHOD__, __CLASS__), E_USER_DEPRECATED); return $this->get($name); } @@ -111,7 +111,7 @@ public function __get($name) */ public function __set($name, $value) { - @trigger_error(sprintf('Direct property access will not be supported in 7.0 in %s::%s.', __METHOD__, __CLASS__), E_USER_DEPRECATED); + @trigger_error(\sprintf('Direct property access will not be supported in 7.0 in %s::%s.', __METHOD__, __CLASS__), E_USER_DEPRECATED); return $this->set($name, $value); } @@ -130,7 +130,7 @@ public function __set($name, $value) */ public function __isset($name) { - @trigger_error(sprintf('Direct property access will not be supported in 7.0 in %s::%s.', __METHOD__, __CLASS__), E_USER_DEPRECATED); + @trigger_error(\sprintf('Direct property access will not be supported in 7.0 in %s::%s.', __METHOD__, __CLASS__), E_USER_DEPRECATED); return $this->exists($name); } diff --git a/libraries/src/Mail/Mail.php b/libraries/src/Mail/Mail.php index 0c33af51780c2..4e20c60dda811 100644 --- a/libraries/src/Mail/Mail.php +++ b/libraries/src/Mail/Mail.php @@ -62,7 +62,7 @@ public function __construct($exceptions = true) // Configure a callback function to handle errors when $this->debug() is called $this->Debugoutput = function ($message, $level) { - Log::add(sprintf('Error in Mail API: %s', $message), Log::ERROR, 'mail'); + Log::add(\sprintf('Error in Mail API: %s', $message), Log::ERROR, 'mail'); }; // If debug mode is enabled then set SMTPDebug to the maximum level @@ -211,7 +211,7 @@ public function setSender($from, $name = '') // If it is neither, we log a message and throw an exception Log::add(Text::sprintf('JLIB_MAIL_INVALID_EMAIL_SENDER', $from), Log::WARNING, 'jerror'); - throw new \UnexpectedValueException(sprintf('Invalid email sender: %s', $from)); + throw new \UnexpectedValueException(\sprintf('Invalid email sender: %s', $from)); } if ($result === false) { diff --git a/libraries/src/Menu/SiteMenu.php b/libraries/src/Menu/SiteMenu.php index 2f6023c2fef7a..a0dba70a0943c 100644 --- a/libraries/src/Menu/SiteMenu.php +++ b/libraries/src/Menu/SiteMenu.php @@ -72,7 +72,7 @@ public function __construct($options = []) $this->language = isset($options['language']) && $options['language'] instanceof Language ? $options['language'] : Factory::getLanguage(); if (!isset($options['db']) || !($options['db'] instanceof DatabaseDriver)) { - @trigger_error(sprintf('Database will be mandatory in 5.0.'), E_USER_DEPRECATED); + @trigger_error(\sprintf('Database will be mandatory in 5.0.'), E_USER_DEPRECATED); $options['db'] = Factory::getContainer()->get(DatabaseDriver::class); } diff --git a/libraries/src/Plugin/PluginHelper.php b/libraries/src/Plugin/PluginHelper.php index b35348dd7e15b..9977628cc163d 100644 --- a/libraries/src/Plugin/PluginHelper.php +++ b/libraries/src/Plugin/PluginHelper.php @@ -187,9 +187,9 @@ public static function importPlugin($type, $plugin = null, $autocreate = true, ? $plugins = static::load(); // Get the specified plugin(s). - for ($i = 0, $t = \count($plugins); $i < $t; $i++) { - if ($plugins[$i]->type === $type && ($plugin === null || $plugins[$i]->name === $plugin)) { - static::import($plugins[$i], $autocreate, $dispatcher); + foreach ($plugins as $value) { + if ($value->type === $type && ($plugin === null || $value->name === $plugin)) { + static::import($value, $autocreate, $dispatcher); $results = true; } } diff --git a/libraries/src/Profiler/Profiler.php b/libraries/src/Profiler/Profiler.php index 6bc1dcbe26581..73b755c895e24 100644 --- a/libraries/src/Profiler/Profiler.php +++ b/libraries/src/Profiler/Profiler.php @@ -121,7 +121,7 @@ public function mark($label) ]; $this->marks[] = $m; - $mark = sprintf( + $mark = \sprintf( '%s %.3f seconds (%.3f); %0.2f MB (%0.3f) - %s', $m->prefix, $m->totalTime / 1000, diff --git a/libraries/src/Proxy/ArrayReadOnlyProxy.php b/libraries/src/Proxy/ArrayReadOnlyProxy.php index 8bb657de28a69..ad57a64d96e06 100644 --- a/libraries/src/Proxy/ArrayReadOnlyProxy.php +++ b/libraries/src/Proxy/ArrayReadOnlyProxy.php @@ -62,6 +62,6 @@ public function offsetGet(mixed $offset): mixed */ public function offsetSet(mixed $offset, mixed $value): void { - throw new \RuntimeException(sprintf('ArrayReadOnlyProxy: trying to modify read-only element, by key "%s"', $offset)); + throw new \RuntimeException(\sprintf('ArrayReadOnlyProxy: trying to modify read-only element, by key "%s"', $offset)); } } diff --git a/libraries/src/Proxy/ObjectReadOnlyProxy.php b/libraries/src/Proxy/ObjectReadOnlyProxy.php index d61d7e6f6f304..938972e342d30 100644 --- a/libraries/src/Proxy/ObjectReadOnlyProxy.php +++ b/libraries/src/Proxy/ObjectReadOnlyProxy.php @@ -64,7 +64,7 @@ public function __get($key): mixed */ public function __set($key, $value): void { - throw new \RuntimeException(sprintf('ObjectReadOnlyProxy: trying to modify read-only element, by key "%s"', $key)); + throw new \RuntimeException(\sprintf('ObjectReadOnlyProxy: trying to modify read-only element, by key "%s"', $key)); } /** diff --git a/libraries/src/Router/ApiRouter.php b/libraries/src/Router/ApiRouter.php index e7d7387fd5dd7..c10cfe396bbb9 100644 --- a/libraries/src/Router/ApiRouter.php +++ b/libraries/src/Router/ApiRouter.php @@ -93,7 +93,7 @@ public function parseApiRoute($method = 'GET') $validMethods = ["GET", "POST", "PUT", "DELETE", "HEAD", "TRACE", "PATCH"]; if (!\in_array($method, $validMethods)) { - throw new \InvalidArgumentException(sprintf('%s is not a valid HTTP method.', $method)); + throw new \InvalidArgumentException(\sprintf('%s is not a valid HTTP method.', $method)); } // Get the path from the route and remove and leading or trailing slash. @@ -121,7 +121,7 @@ public function parseApiRoute($method = 'GET') } } - throw new RouteNotFoundException(sprintf('Unable to handle request for route `%s`.', $routePath)); + throw new RouteNotFoundException(\sprintf('Unable to handle request for route `%s`.', $routePath)); } /** diff --git a/libraries/src/Router/Router.php b/libraries/src/Router/Router.php index 16237592222c5..1e40cd40cd0cf 100644 --- a/libraries/src/Router/Router.php +++ b/libraries/src/Router/Router.php @@ -286,7 +286,7 @@ public function getVars() public function attachBuildRule(callable $callback, $stage = self::PROCESS_DURING) { if (!\array_key_exists('build' . $stage, $this->rules)) { - throw new \InvalidArgumentException(sprintf('The %s stage is not registered. (%s)', $stage, __METHOD__)); + throw new \InvalidArgumentException(\sprintf('The %s stage is not registered. (%s)', $stage, __METHOD__)); } $this->rules['build' . $stage][] = $callback; @@ -308,7 +308,7 @@ public function attachBuildRule(callable $callback, $stage = self::PROCESS_DURIN public function attachParseRule(callable $callback, $stage = self::PROCESS_DURING) { if (!\array_key_exists('parse' . $stage, $this->rules)) { - throw new \InvalidArgumentException(sprintf('The %s stage is not registered. (%s)', $stage, __METHOD__)); + throw new \InvalidArgumentException(\sprintf('The %s stage is not registered. (%s)', $stage, __METHOD__)); } $this->rules['parse' . $stage][] = $callback; @@ -332,11 +332,11 @@ public function attachParseRule(callable $callback, $stage = self::PROCESS_DURIN public function detachRule($type, $rule, $stage = self::PROCESS_DURING) { if (!\in_array($type, ['parse', 'build'])) { - throw new \InvalidArgumentException(sprintf('The %s type is not supported. (%s)', $type, __METHOD__)); + throw new \InvalidArgumentException(\sprintf('The %s type is not supported. (%s)', $type, __METHOD__)); } if (!\array_key_exists($type . $stage, $this->rules)) { - throw new \InvalidArgumentException(sprintf('The %s stage is not registered. (%s)', $stage, __METHOD__)); + throw new \InvalidArgumentException(\sprintf('The %s stage is not registered. (%s)', $stage, __METHOD__)); } foreach ($this->rules[$type . $stage] as $id => $r) { @@ -377,7 +377,7 @@ public function getRules() protected function processParseRules(&$uri, $stage = self::PROCESS_DURING) { if (!\array_key_exists('parse' . $stage, $this->rules)) { - throw new \InvalidArgumentException(sprintf('The %s stage is not registered. (%s)', $stage, __METHOD__)); + throw new \InvalidArgumentException(\sprintf('The %s stage is not registered. (%s)', $stage, __METHOD__)); } foreach ($this->rules['parse' . $stage] as $rule) { @@ -400,7 +400,7 @@ protected function processParseRules(&$uri, $stage = self::PROCESS_DURING) protected function processBuildRules(&$uri, $stage = self::PROCESS_DURING) { if (!\array_key_exists('build' . $stage, $this->rules)) { - throw new \InvalidArgumentException(sprintf('The %s stage is not registered. (%s)', $stage, __METHOD__)); + throw new \InvalidArgumentException(\sprintf('The %s stage is not registered. (%s)', $stage, __METHOD__)); } foreach ($this->rules['build' . $stage] as $rule) { diff --git a/libraries/src/Schema/ChangeItem.php b/libraries/src/Schema/ChangeItem.php index 70080080d5630..97d11315e1c81 100644 --- a/libraries/src/Schema/ChangeItem.php +++ b/libraries/src/Schema/ChangeItem.php @@ -156,7 +156,7 @@ public static function getInstance($db, $file, $query) return new $class($db, $file, $query); } - throw new \RuntimeException(sprintf('ChangeItem child class not found for the %s database driver', $serverType), 500); + throw new \RuntimeException(\sprintf('ChangeItem child class not found for the %s database driver', $serverType), 500); } /** diff --git a/libraries/src/Serializer/JoomlaSerializer.php b/libraries/src/Serializer/JoomlaSerializer.php index e2e1bcd551da4..70dad8978239c 100644 --- a/libraries/src/Serializer/JoomlaSerializer.php +++ b/libraries/src/Serializer/JoomlaSerializer.php @@ -52,7 +52,7 @@ public function __construct(string $type) public function getAttributes($post, ?array $fields = null) { if (!\is_array($post) && !\is_object($post)) { - $message = sprintf( + $message = \sprintf( 'Invalid argument for %s. Expected array or object. Got %s', static::class, \gettype($post) diff --git a/libraries/src/Service/Provider/Authentication.php b/libraries/src/Service/Provider/Authentication.php index bc61cea1b5037..5ebb90e67f611 100644 --- a/libraries/src/Service/Provider/Authentication.php +++ b/libraries/src/Service/Provider/Authentication.php @@ -105,7 +105,7 @@ function (Container $container) { MD5Handler::class, function (Container $container) { @trigger_error( - sprintf( + \sprintf( 'The "%1$s" class service is deprecated, use the "%2$s" service for the active password handler instead.', MD5Handler::class, 'password.handler.default' @@ -123,7 +123,7 @@ function (Container $container) { PHPassHandler::class, function (Container $container) { @trigger_error( - sprintf( + \sprintf( 'The "%1$s" class service is deprecated, use the "%2$s" service for the active password handler instead.', PHPassHandler::class, 'password.handler.default' diff --git a/libraries/src/Service/Provider/Session.php b/libraries/src/Service/Provider/Session.php index 4fe992d9e3589..a65039891c7d3 100644 --- a/libraries/src/Service/Provider/Session.php +++ b/libraries/src/Service/Provider/Session.php @@ -258,7 +258,7 @@ function (Container $container) { */ if (!Factory::$application) { throw new DependencyResolutionException( - sprintf( + \sprintf( 'Creating the "session.metadata_manager" service requires %s::$application be initialised.', Factory::class ) diff --git a/libraries/src/Session/SessionFactory.php b/libraries/src/Session/SessionFactory.php index 61b0af9438dae..35707c596098d 100644 --- a/libraries/src/Session/SessionFactory.php +++ b/libraries/src/Session/SessionFactory.php @@ -126,7 +126,7 @@ public function createSessionHandler(array $options): HandlerInterface return new Handler\RedisHandler($redis, ['ttl' => $options['expire']]); default: - throw new \InvalidArgumentException(sprintf('The "%s" session handler is not recognised.', $handlerType)); + throw new \InvalidArgumentException(\sprintf('The "%s" session handler is not recognised.', $handlerType)); } } diff --git a/libraries/src/String/PunycodeHelper.php b/libraries/src/String/PunycodeHelper.php index 0946a3874c040..48e397e56e118 100644 --- a/libraries/src/String/PunycodeHelper.php +++ b/libraries/src/String/PunycodeHelper.php @@ -196,7 +196,7 @@ public static function urlToUTF8($uri) public static function emailToPunycode($email) { if ($email === null) { - @trigger_error(sprintf('Passing null value is deprecated in %s and will throw an exception in 6.0.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(\sprintf('Passing null value is deprecated in %s and will throw an exception in 6.0.', __METHOD__), E_USER_DEPRECATED); return ''; } diff --git a/libraries/src/Table/Asset.php b/libraries/src/Table/Asset.php index 306a335183f86..fedf2b6797879 100644 --- a/libraries/src/Table/Asset.php +++ b/libraries/src/Table/Asset.php @@ -175,7 +175,7 @@ public function rebuild($parentId = null, $leftId = 0, $level = 0, $path = null) // Make a shortcut to database object. // Assemble the query to find all children of this node. - $this->_db->setQuery(sprintf($this->_cache['rebuild.sql'], (int) $parentId)); + $this->_db->setQuery(\sprintf($this->_cache['rebuild.sql'], (int) $parentId)); $children = $this->_db->loadObjectList(); diff --git a/libraries/src/Table/ContentType.php b/libraries/src/Table/ContentType.php index 862e388d0393a..d72de3dd52380 100644 --- a/libraries/src/Table/ContentType.php +++ b/libraries/src/Table/ContentType.php @@ -57,13 +57,13 @@ public function check() // Check for valid name. if (trim($this->type_title) === '') { - throw new \UnexpectedValueException(sprintf('The title is empty')); + throw new \UnexpectedValueException(\sprintf('The title is empty')); } $this->type_title = ucfirst($this->type_title); if (empty($this->type_alias)) { - throw new \UnexpectedValueException(sprintf('The type_alias is empty')); + throw new \UnexpectedValueException(\sprintf('The type_alias is empty')); } return true; diff --git a/libraries/src/Table/Nested.php b/libraries/src/Table/Nested.php index 6eedf829bec34..156f5265357a2 100644 --- a/libraries/src/Table/Nested.php +++ b/libraries/src/Table/Nested.php @@ -235,7 +235,7 @@ public function setLocation($referenceId, $position = 'after') // Make sure the location is valid. if (!\in_array($position, $this->_validLocations)) { throw new \InvalidArgumentException( - sprintf('Invalid location "%1$s" given, valid values are %2$s', $position, implode(', ', $this->_validLocations)) + \sprintf('Invalid location "%1$s" given, valid values are %2$s', $position, implode(', ', $this->_validLocations)) ); } @@ -334,7 +334,7 @@ public function moveByReference($referenceId, $position = 'after', $pk = null, $ if (\in_array($referenceId, $children)) { $this->setError( new \UnexpectedValueException( - sprintf('%1$s::moveByReference() is trying to make record ID %2$d a child of itself.', \get_class($this), $pk) + \sprintf('%1$s::moveByReference() is trying to make record ID %2$d a child of itself.', \get_class($this), $pk) ) ); @@ -663,7 +663,7 @@ public function check() try { // Check that the parent_id field is valid. if ($this->parent_id == 0) { - throw new \UnexpectedValueException(sprintf('Invalid `parent_id` [%1$d] in %2$s::check()', $this->parent_id, \get_class($this))); + throw new \UnexpectedValueException(\sprintf('Invalid `parent_id` [%1$d] in %2$s::check()', $this->parent_id, \get_class($this))); } $query = $this->_db->getQuery(true) @@ -672,7 +672,7 @@ public function check() ->where($this->_tbl_key . ' = ' . $this->parent_id); if (!$this->_db->setQuery($query)->loadResult()) { - throw new \UnexpectedValueException(sprintf('Invalid `parent_id` [%1$d] in %2$s::check()', $this->parent_id, \get_class($this))); + throw new \UnexpectedValueException(\sprintf('Invalid `parent_id` [%1$d] in %2$s::check()', $this->parent_id, \get_class($this))); } } catch (\UnexpectedValueException $e) { // Validation error - record it and return false. @@ -786,7 +786,7 @@ public function store($updateNulls = false) $this->rgt = $repositionData->new_rgt; } else { // Negative parent ids are invalid - $e = new \UnexpectedValueException(sprintf('%s::store() used a negative _location_id', \get_class($this))); + $e = new \UnexpectedValueException(\sprintf('%s::store() used a negative _location_id', \get_class($this))); $this->setError($e); return false; @@ -893,7 +893,7 @@ public function publish($pks = null, $state = 1, $userId = 0) $pks = explode(',', $this->$k); } else { // Nothing to set publishing state on, return false. - $e = new \UnexpectedValueException(sprintf('%s::publish(%s, %d, %d) empty.', \get_class($this), implode(',', $pks), $state, $userId)); + $e = new \UnexpectedValueException(\sprintf('%s::publish(%s, %d, %d) empty.', \get_class($this), implode(',', $pks), $state, $userId)); $this->setError($e); return false; @@ -924,7 +924,7 @@ public function publish($pks = null, $state = 1, $userId = 0) // Check for checked out children. if ($this->_db->loadResult()) { // @todo Convert to a conflict exception when available. - $e = new \RuntimeException(sprintf('%s::publish(%s, %d, %d) checked-out conflict.', \get_class($this), $pks[0], $state, $userId)); + $e = new \RuntimeException(\sprintf('%s::publish(%s, %d, %d) checked-out conflict.', \get_class($this), $pks[0], $state, $userId)); $this->setError($e); @@ -949,7 +949,7 @@ public function publish($pks = null, $state = 1, $userId = 0) if ($this->_db->loadResult()) { $e = new \UnexpectedValueException( - sprintf('%s::publish(%s, %d, %d) ancestors have lower state.', \get_class($this), $pks[0], $state, $userId) + \sprintf('%s::publish(%s, %d, %d) ancestors have lower state.', \get_class($this), $pks[0], $state, $userId) ); $this->setError($e); @@ -1193,7 +1193,7 @@ public function getRootId() } } - $e = new \UnexpectedValueException(sprintf('%s::getRootId', \get_class($this))); + $e = new \UnexpectedValueException(\sprintf('%s::getRootId', \get_class($this))); $this->setError($e); self::$root_id = false; @@ -1247,7 +1247,7 @@ public function rebuild($parentId = null, $leftId = 0, $level = 0, $path = '') // Make a shortcut to database object. // Assemble the query to find all children of this node. - $this->_db->setQuery(sprintf($this->_cache['rebuild.sql'], (int) $parentId)); + $this->_db->setQuery(\sprintf($this->_cache['rebuild.sql'], (int) $parentId)); $children = $this->_db->loadObjectList(); @@ -1524,7 +1524,7 @@ protected function _getNode($id, $key = null) // Check for no $row returned if (empty($row)) { - $e = new \UnexpectedValueException(sprintf('%s::_getNode(%d, %s) failed.', \get_class($this), $id, $k)); + $e = new \UnexpectedValueException(\sprintf('%s::_getNode(%d, %s) failed.', \get_class($this), $id, $k)); $this->setError($e); return false; @@ -1649,11 +1649,11 @@ protected function _logtable($showData = true, $showQuery = true) $this->_db->setQuery($query); $rows = $this->_db->loadRowList(); - $buffer .= sprintf("\n| %4s | %4s | %4s | %4s |", $this->_tbl_key, 'par', 'lft', 'rgt'); + $buffer .= \sprintf("\n| %4s | %4s | %4s | %4s |", $this->_tbl_key, 'par', 'lft', 'rgt'); $buffer .= $sep; foreach ($rows as $row) { - $buffer .= sprintf("\n| %4s | %4s | %4s | %4s |", $row[0], $row[1], $row[2], $row[3]); + $buffer .= \sprintf("\n| %4s | %4s | %4s | %4s |", $row[0], $row[1], $row[2], $row[3]); } $buffer .= $sep; diff --git a/libraries/src/Table/Table.php b/libraries/src/Table/Table.php index baa7b17192bae..af25216eb0ab0 100644 --- a/libraries/src/Table/Table.php +++ b/libraries/src/Table/Table.php @@ -251,7 +251,7 @@ public function getFields($reload = false) $fields = $this->_db->getTableColumns($name, false); if (empty($fields)) { - throw new \UnexpectedValueException(sprintf('No columns found for %s table', $name)); + throw new \UnexpectedValueException(\sprintf('No columns found for %s table', $name)); } self::$tableFields[$key] = $fields; @@ -639,7 +639,7 @@ public function bind($src, $ignore = []) // Check if the source value is an array or object if (!\is_object($src) && !\is_array($src)) { throw new \InvalidArgumentException( - sprintf( + \sprintf( 'Could not bind the data source in %1$s::bind(), the source must be an array or object but a "%2$s" was given.', \get_class($this), \gettype($src) @@ -768,7 +768,7 @@ public function load($keys = null, $reset = true) foreach ($keys as $field => $value) { // Check that $field is in the table. if (!\in_array($field, $fields)) { - throw new \UnexpectedValueException(sprintf('Missing field in database: %s   %s.', \get_class($this), $field)); + throw new \UnexpectedValueException(\sprintf('Missing field in database: %s   %s.', \get_class($this), $field)); } // Add the search tuple to the query. @@ -1422,7 +1422,7 @@ public function getNextOrder($where = '') { // Check if there is an ordering field set if (!$this->hasField('ordering')) { - throw new \UnexpectedValueException(sprintf('%s does not support ordering.', \get_class($this))); + throw new \UnexpectedValueException(\sprintf('%s does not support ordering.', \get_class($this))); } // Get the largest ordering value for a given where clause. @@ -1477,7 +1477,7 @@ public function reorder($where = '') { // Check if there is an ordering field set if (!$this->hasField('ordering')) { - throw new \UnexpectedValueException(sprintf('%s does not support ordering.', \get_class($this))); + throw new \UnexpectedValueException(\sprintf('%s does not support ordering.', \get_class($this))); } $quotedOrderingField = $this->_db->quoteName($this->getColumnAlias('ordering')); @@ -1556,7 +1556,7 @@ public function move($delta, $where = '') { // Check if there is an ordering field set if (!$this->hasField('ordering')) { - throw new \UnexpectedValueException(sprintf('%s does not support ordering.', \get_class($this))); + throw new \UnexpectedValueException(\sprintf('%s does not support ordering.', \get_class($this))); } $orderingField = $this->getColumnAlias('ordering'); diff --git a/libraries/src/Table/Usergroup.php b/libraries/src/Table/Usergroup.php index fbc964da0d0b7..a9fdc4c9e4cbc 100644 --- a/libraries/src/Table/Usergroup.php +++ b/libraries/src/Table/Usergroup.php @@ -158,9 +158,9 @@ public function rebuild($parentId = 0, $left = 0) $right = $left + 1; // Execute this function recursively over all children - for ($i = 0, $n = \count($children); $i < $n; $i++) { + foreach ($children as $child) { // $right is the current right value, which is incremented on recursion return - $right = $this->rebuild($children[$i], $right); + $right = $this->rebuild($child, $right); // If there is an update failure, return false to break out of the recursion if ($right === false) { diff --git a/libraries/src/Toolbar/ContainerAwareToolbarFactory.php b/libraries/src/Toolbar/ContainerAwareToolbarFactory.php index 365a241190cb0..99ff06e3ac6c7 100644 --- a/libraries/src/Toolbar/ContainerAwareToolbarFactory.php +++ b/libraries/src/Toolbar/ContainerAwareToolbarFactory.php @@ -60,7 +60,7 @@ public function createButton(Toolbar $toolbar, string $type): ToolbarButton } if (!class_exists($buttonClass)) { - throw new \InvalidArgumentException(sprintf('Class `%1$s` does not exist, could not create a toolbar button.', $buttonClass)); + throw new \InvalidArgumentException(\sprintf('Class `%1$s` does not exist, could not create a toolbar button.', $buttonClass)); } // Check for a possible service from the container otherwise manually instantiate the class diff --git a/libraries/src/Toolbar/Toolbar.php b/libraries/src/Toolbar/Toolbar.php index 4a5904fa96e17..6e761db08e4ba 100644 --- a/libraries/src/Toolbar/Toolbar.php +++ b/libraries/src/Toolbar/Toolbar.php @@ -107,7 +107,7 @@ public function __construct($name = 'toolbar', ?ToolbarFactoryInterface $factory // At 5.0, require the factory to be injected if (!$factory) { @trigger_error( - sprintf( + \sprintf( 'As of Joomla! 5.0, a %1$s must be provided to a %2$s object when creating it.', ToolbarFactoryInterface::class, \get_class($this) @@ -197,7 +197,7 @@ public function appendButton($button, ...$args) $this->_bar[] = $args; @trigger_error( - sprintf( + \sprintf( '%s::appendButton() should only accept %s instance in Joomla 6.0.', static::class, ToolbarButton::class @@ -274,7 +274,7 @@ public function prependButton($button, ...$args) array_unshift($this->_bar, $args); @trigger_error( - sprintf( + \sprintf( '%s::prependButton() should only accept %s instance in Joomla 6.0.', static::class, ToolbarButton::class @@ -408,7 +408,7 @@ public function loadButtonType($type, $new = false) public function addButtonPath($path) { @trigger_error( - sprintf( + \sprintf( 'Registering lookup paths for toolbar buttons is deprecated and will be removed in Joomla 6.0.' . ' %1$s objects should be autoloaded or a custom %2$s implementation supporting path lookups provided.', ToolbarButton::class, @@ -445,7 +445,7 @@ public function addButtonPath($path) public function getButtonPath(): array { @trigger_error( - sprintf( + \sprintf( 'Lookup paths for %s objects is deprecated and will be removed in Joomla 6.0.', ToolbarButton::class ), @@ -496,7 +496,7 @@ public function __call($name, $args) } throw new \BadMethodCallException( - sprintf( + \sprintf( 'Method %s() not found in class: %s', $name, static::class diff --git a/libraries/src/Toolbar/ToolbarButton.php b/libraries/src/Toolbar/ToolbarButton.php index 48e31df54f621..7c98b47f4a235 100644 --- a/libraries/src/Toolbar/ToolbarButton.php +++ b/libraries/src/Toolbar/ToolbarButton.php @@ -448,7 +448,7 @@ public function __call(string $name, array $args) if ($fieldName !== false) { if (!\array_key_exists(0, $args)) { throw new \InvalidArgumentException( - sprintf( + \sprintf( '%s::%s() miss first argument.', \get_called_class(), $name @@ -461,7 +461,7 @@ public function __call(string $name, array $args) } throw new \BadMethodCallException( - sprintf( + \sprintf( 'Method %s() not found in class: %s', $name, \get_called_class() diff --git a/libraries/src/Updater/Update.php b/libraries/src/Updater/Update.php index 2d27eb41f9e5b..54826d1badd0f 100644 --- a/libraries/src/Updater/Update.php +++ b/libraries/src/Updater/Update.php @@ -663,7 +663,7 @@ public function loadFromXml($url, $minimumStability = Updater::STABILITY_STABLE, if (!xml_parse($this->xmlParser, $response->body)) { Log::add( - sprintf( + \sprintf( 'XML error: %s at line %d', xml_error_string(xml_get_error_code($this->xmlParser)), xml_get_current_line_number($this->xmlParser) diff --git a/libraries/src/Updater/UpdateAdapter.php b/libraries/src/Updater/UpdateAdapter.php index fb3add2241c6e..537c3a0385e5b 100644 --- a/libraries/src/Updater/UpdateAdapter.php +++ b/libraries/src/Updater/UpdateAdapter.php @@ -258,7 +258,7 @@ protected function getUpdateSiteResponse($options = []) // Log the time it took to load this update site's information $endTime = microtime(true); - $timeToLoad = sprintf('%0.2f', $endTime - $startTime); + $timeToLoad = \sprintf('%0.2f', $endTime - $startTime); Log::add( "Loading information from update site #{$this->updateSiteId} with name " . "\"$this->updateSiteName\" and URL $url took $timeToLoad seconds", diff --git a/libraries/src/User/CurrentUserTrait.php b/libraries/src/User/CurrentUserTrait.php index 5a1f57b58052a..bafe46e0a3e81 100644 --- a/libraries/src/User/CurrentUserTrait.php +++ b/libraries/src/User/CurrentUserTrait.php @@ -42,7 +42,7 @@ protected function getCurrentUser(): User { if (!$this->currentUser) { @trigger_error( - sprintf('User must be set in %s. This will not be caught anymore in 6.0', __METHOD__), + \sprintf('User must be set in %s. This will not be caught anymore in 6.0', __METHOD__), E_USER_DEPRECATED ); $this->currentUser = Factory::getApplication()->getIdentity() ?: Factory::getUser(); diff --git a/libraries/src/User/User.php b/libraries/src/User/User.php index 9025767512ef6..88410288c0397 100644 --- a/libraries/src/User/User.php +++ b/libraries/src/User/User.php @@ -298,7 +298,7 @@ public function __construct($identifier = 0) public static function getInstance($identifier = 0) { @trigger_error( - sprintf( + \sprintf( '%1$s() is deprecated. Load the user from the dependency injection container or via %2$s::getApplication()->getIdentity().', __METHOD__, __CLASS__ @@ -525,7 +525,7 @@ public function setLastVisit($timestamp = null) { // Create the user table object /** @var \Joomla\CMS\Table\User $table */ - $table = $this->getTable(); + $table = static::getTable(); $table->load($this->id); return $table->setLastVisit($timestamp); @@ -701,7 +701,7 @@ public function bind(&$array) public function save($updateOnly = false) { // Create the user table object - $table = $this->getTable(); + $table = static::getTable(); $this->params = (string) $this->_params; $table->bind($this->getProperties()); @@ -833,7 +833,7 @@ public function delete() ])); // Create the user table object - $table = $this->getTable(); + $table = static::getTable(); if (!$result = $table->delete($this->id)) { $this->setError($table->getError()); @@ -861,7 +861,7 @@ public function delete() public function load($id) { // Create the user table object - $table = $this->getTable(); + $table = static::getTable(); // Load the UserModel object based on the user id or throw a warning. if (!$table->load($id)) { diff --git a/libraries/src/User/UserHelper.php b/libraries/src/User/UserHelper.php index df178918a61da..8e40457a88504 100644 --- a/libraries/src/User/UserHelper.php +++ b/libraries/src/User/UserHelper.php @@ -295,8 +295,8 @@ public static function setUserGroups($userId, $groups) $results = $db->loadObjectList(); // Set the titles for the user groups. - for ($i = 0, $n = \count($results); $i < $n; $i++) { - $user->groups[$results[$i]->id] = $results[$i]->id; + foreach ($results as $result) { + $user->groups[$result->id] = $result->id; } // Store the user object. @@ -443,7 +443,7 @@ public static function hashPassword($password, $algorithm = self::HASH_BCRYPT, a } // Unsupported algorithm, sorry! - throw new \InvalidArgumentException(sprintf('The %s algorithm is not supported for hashing passwords.', $algorithm)); + throw new \InvalidArgumentException(\sprintf('The %s algorithm is not supported for hashing passwords.', $algorithm)); } /** diff --git a/libraries/src/WebAsset/WebAssetManager.php b/libraries/src/WebAsset/WebAssetManager.php index 63b5c88d9c192..b7d6dd4633baf 100644 --- a/libraries/src/WebAsset/WebAssetManager.php +++ b/libraries/src/WebAsset/WebAssetManager.php @@ -248,7 +248,7 @@ public function __call($method, $arguments) return $this->registerAsset($type, ...$arguments); } - throw new \BadMethodCallException(sprintf('Undefined method %s in class %s', $method, \get_class($this))); + throw new \BadMethodCallException(\sprintf('Undefined method %s in class %s', $method, \get_class($this))); } /** @@ -383,7 +383,7 @@ protected function usePresetItems($name): WebAssetManagerInterface // Make sure dependency exists if (!$this->registry->exists($depType, $depName)) { throw new UnsatisfiedDependencyException( - sprintf('Unsatisfied dependency "%s" for an asset "%s" of type "%s"', $dependency, $name, 'preset') + \sprintf('Unsatisfied dependency "%s" for an asset "%s" of type "%s"', $dependency, $name, 'preset') ); } @@ -426,7 +426,7 @@ protected function disablePresetItems($name): WebAssetManagerInterface // Make sure dependency exists if (!$this->registry->exists($depType, $depName)) { throw new UnsatisfiedDependencyException( - sprintf('Unsatisfied dependency "%s" for an asset "%s" of type "%s"', $dependency, $name, 'preset') + \sprintf('Unsatisfied dependency "%s" for an asset "%s" of type "%s"', $dependency, $name, 'preset') ); } @@ -525,7 +525,7 @@ public function registerAsset(string $type, $asset, string $uri = '', array $opt $this->registry->add($type, $assetInstance); } else { throw new \InvalidArgumentException( - sprintf( + \sprintf( '%s(): Argument #2 ($asset) must be a string or an instance of %s, %s given.', __METHOD__, WebAssetItemInterface::class, @@ -696,7 +696,7 @@ public function addInline(string $type, $content, array $options = [], array $at $assetInstance->setOption('content', $content); } else { throw new \InvalidArgumentException( - sprintf( + \sprintf( '%s(): Argument #2 ($content) must be a string or an instance of %s, %s given.', __METHOD__, WebAssetItemInterface::class, @@ -1004,7 +1004,7 @@ protected function getDependenciesForAsset( if (!$this->registry->exists($depType, $depName)) { throw new UnsatisfiedDependencyException( - sprintf('Unsatisfied dependency "%s" for an asset "%s" of type "%s"', $depName, $asset->getName(), $depType) + \sprintf('Unsatisfied dependency "%s" for an asset "%s" of type "%s"', $depName, $asset->getName(), $depType) ); } diff --git a/libraries/src/WebAsset/WebAssetRegistry.php b/libraries/src/WebAsset/WebAssetRegistry.php index c0dfa2d4aeda1..7f74b11db8330 100644 --- a/libraries/src/WebAsset/WebAssetRegistry.php +++ b/libraries/src/WebAsset/WebAssetRegistry.php @@ -132,7 +132,7 @@ public function get(string $type, string $name): WebAssetItemInterface $this->parseRegistryFiles(); if (empty($this->assets[$type][$name])) { - throw new UnknownAssetException(sprintf('There is no "%s" asset of a "%s" type in the registry.', $name, $type)); + throw new UnknownAssetException(\sprintf('There is no "%s" asset of a "%s" type in the registry.', $name, $type)); } return $this->assets[$type][$name]; @@ -374,7 +374,7 @@ protected function parseRegistryFile($path) $data = $data ? json_decode($data, true) : null; if ($data === null) { - throw new \RuntimeException(sprintf('Asset registry file "%s" contains invalid JSON', $path)); + throw new \RuntimeException(\sprintf('Asset registry file "%s" contains invalid JSON', $path)); } // Check if asset field exists and contains data. If it doesn't - we can just bail here. @@ -393,13 +393,13 @@ protected function parseRegistryFile($path) foreach ($data['assets'] as $i => $item) { if (empty($item['name'])) { throw new \RuntimeException( - sprintf('Failed parsing asset registry file "%s". Property "name" is required for asset index "%s"', $path, $i) + \sprintf('Failed parsing asset registry file "%s". Property "name" is required for asset index "%s"', $path, $i) ); } if (empty($item['type'])) { throw new \RuntimeException( - sprintf('Failed parsing asset registry file "%s". Property "type" is required for asset "%s"', $path, $item['name']) + \sprintf('Failed parsing asset registry file "%s". Property "type" is required for asset "%s"', $path, $item['name']) ); } diff --git a/modules/mod_articles/services/provider.php b/modules/mod_articles/services/provider.php index f1dabc182809a..23aec5fe033a8 100644 --- a/modules/mod_articles/services/provider.php +++ b/modules/mod_articles/services/provider.php @@ -19,7 +19,7 @@ /** * The articles module service provider. * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ return new class () implements ServiceProviderInterface { /** diff --git a/modules/mod_articles/src/Dispatcher/Dispatcher.php b/modules/mod_articles/src/Dispatcher/Dispatcher.php index a63bf8fa43eb4..f3c93d9c25289 100644 --- a/modules/mod_articles/src/Dispatcher/Dispatcher.php +++ b/modules/mod_articles/src/Dispatcher/Dispatcher.php @@ -22,7 +22,7 @@ /** * Dispatcher class for mod_articles * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ class Dispatcher extends AbstractModuleDispatcher implements HelperFactoryAwareInterface { @@ -33,7 +33,7 @@ class Dispatcher extends AbstractModuleDispatcher implements HelperFactoryAwareI * * @return array * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ protected function getLayoutData(): array { diff --git a/modules/mod_articles/src/Helper/ArticlesHelper.php b/modules/mod_articles/src/Helper/ArticlesHelper.php index 734c9c2c8fa9c..cf737adb0180e 100644 --- a/modules/mod_articles/src/Helper/ArticlesHelper.php +++ b/modules/mod_articles/src/Helper/ArticlesHelper.php @@ -32,7 +32,7 @@ /** * Helper for mod_articles * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ class ArticlesHelper implements DatabaseAwareInterface { @@ -46,7 +46,7 @@ class ArticlesHelper implements DatabaseAwareInterface * * @return object[] * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ public function getArticles(Registry $params, SiteApplication $app) { @@ -331,7 +331,7 @@ public function getArticles(Registry $params, SiteApplication $app) * * @return array * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ public static function groupBy($list, $fieldName, $direction, $fieldNameToKeep = null) { @@ -375,7 +375,7 @@ public static function groupBy($list, $fieldName, $direction, $fieldNameToKeep = * * @return array * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ public static function groupByDate($list, $direction = 'ksort', $type = 'year', $monthYearFormat = 'F Y', $field = 'created') { @@ -438,7 +438,7 @@ public static function groupByDate($list, $direction = 'ksort', $type = 'year', * * @return array * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ public static function groupByTags($list, $direction = 'ksort') { diff --git a/package-lock.json b/package-lock.json index 22e8c12352436..6ed01b108067d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,7 +31,7 @@ "@webcomponents/webcomponentsjs": "^2.8.0", "accessibility": "^3.0.17", "awesomplete": "^1.1.5", - "bootstrap": "5.3.2", + "bootstrap": "5.3.3", "choices.js": "^9.1.0", "chosen-js": "^1.8.7", "cropperjs": "^1.6.1", @@ -3860,9 +3860,9 @@ "license": "ISC" }, "node_modules/bootstrap": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.2.tgz", - "integrity": "sha512-D32nmNWiQHo94BKHLmOrdjlL05q1c8oxbtBphQFb9Z5to6eGRDCm0QgeaZ4zFBHzfg2++rqa2JkqCcxDy0sH0g==", + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.3.tgz", + "integrity": "sha512-8HLCdWgyoMguSO9o+aH+iuZ+aht+mzW0u3HIMzVu7Srrpv7EBBxTnrFlSCskwdY1+EOFQSm7uMJhNQHkdPcmjg==", "funding": [ { "type": "github", @@ -8174,9 +8174,9 @@ "license": "MIT" }, "node_modules/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 0a28522bbfe7b..45989a6be0a4f 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "@webcomponents/webcomponentsjs": "^2.8.0", "accessibility": "^3.0.17", "awesomplete": "^1.1.5", - "bootstrap": "5.3.2", + "bootstrap": "5.3.3", "choices.js": "^9.1.0", "chosen-js": "^1.8.7", "cropperjs": "^1.6.1", diff --git a/plugins/actionlog/joomla/src/Extension/Joomla.php b/plugins/actionlog/joomla/src/Extension/Joomla.php index 4c407485209e3..be2683ae77b98 100644 --- a/plugins/actionlog/joomla/src/Extension/Joomla.php +++ b/plugins/actionlog/joomla/src/Extension/Joomla.php @@ -1311,7 +1311,7 @@ public function onUserBeforeSave(User\BeforeSaveEvent $event): void * * @return void * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ public function onBeforeTourSaveUserState(AbstractEvent $event): void { diff --git a/plugins/api-authentication/basic/src/Extension/Basic.php b/plugins/api-authentication/basic/src/Extension/Basic.php index 2ed6bfba5a4a2..8ba09c79310be 100644 --- a/plugins/api-authentication/basic/src/Extension/Basic.php +++ b/plugins/api-authentication/basic/src/Extension/Basic.php @@ -37,7 +37,7 @@ final class Basic extends CMSPlugin implements SubscriberInterface * * @return array * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ public static function getSubscribedEvents(): array { diff --git a/plugins/authentication/cookie/src/Extension/Cookie.php b/plugins/authentication/cookie/src/Extension/Cookie.php index 4be82698a48d4..20b33d8623160 100644 --- a/plugins/authentication/cookie/src/Extension/Cookie.php +++ b/plugins/authentication/cookie/src/Extension/Cookie.php @@ -45,7 +45,7 @@ final class Cookie extends CMSPlugin implements SubscriberInterface * * @return array * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ public static function getSubscribedEvents(): array { @@ -182,7 +182,7 @@ public function onUserAuthenticate(AuthenticationEvent $event): void } catch (\RuntimeException $e) { // Log an alert for the site admin Log::add( - sprintf('Failed to delete cookie token for user %s with the following error: %s', $results[0]->user_id, $e->getMessage()), + \sprintf('Failed to delete cookie token for user %s with the following error: %s', $results[0]->user_id, $e->getMessage()), Log::WARNING, 'security' ); diff --git a/plugins/authentication/ldap/src/Extension/Ldap.php b/plugins/authentication/ldap/src/Extension/Ldap.php index f0084cb1fee8d..326171b6f9f88 100644 --- a/plugins/authentication/ldap/src/Extension/Ldap.php +++ b/plugins/authentication/ldap/src/Extension/Ldap.php @@ -64,7 +64,7 @@ public function __construct(LdapFactoryInterface $factory, DispatcherInterface $ * * @return array * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ public static function getSubscribedEvents(): array { @@ -125,10 +125,10 @@ public function onUserAuthenticate(AuthenticationEvent $event): void } else { $cacertfile = $cacert; $cacertdir = $cacert; - Log::add(sprintf('Certificate path for LDAP client is neither an existing file nor directory: "%s"', $cacert), Log::ERROR, $logcategory); + Log::add(\sprintf('Certificate path for LDAP client is neither an existing file nor directory: "%s"', $cacert), Log::ERROR, $logcategory); } } else { - Log::add(sprintf('Not setting any LDAP TLS CA certificate options because %s, system wide settings are used', $ignore_reqcert_tls ? "certificate is ignored" : "no certificate location is configured"), Log::DEBUG, $logcategory); + Log::add(\sprintf('Not setting any LDAP TLS CA certificate options because %s, system wide settings are used', $ignore_reqcert_tls ? "certificate is ignored" : "no certificate location is configured"), Log::DEBUG, $logcategory); } $options = [ @@ -148,16 +148,16 @@ public function onUserAuthenticate(AuthenticationEvent $event): void $options['options']['x_tls_cacertfile'] = $cacertfile; } - Log::add(sprintf('Creating LDAP session with options: %s', json_encode($options)), Log::DEBUG, $logcategory); - $connection_string = sprintf('ldap%s://%s:%s', 'ssl' === $options['encryption'] ? 's' : '', $options['host'], $options['port']); - Log::add(sprintf('Creating LDAP session to connect to "%s" while binding', $connection_string), Log::DEBUG, $logcategory); + Log::add(\sprintf('Creating LDAP session with options: %s', json_encode($options)), Log::DEBUG, $logcategory); + $connection_string = \sprintf('ldap%s://%s:%s', 'ssl' === $options['encryption'] ? 's' : '', $options['host'], $options['port']); + Log::add(\sprintf('Creating LDAP session to connect to "%s" while binding', $connection_string), Log::DEBUG, $logcategory); $ldap = $this->factory->createLdap($options); switch ($auth_method) { case 'search': try { $dn = $this->params->get('username', ''); - Log::add(sprintf('Binding to LDAP server with administrative dn "%s" and given administrative password (anonymous if user dn is blank)', $dn), Log::DEBUG, $logcategory); + Log::add(\sprintf('Binding to LDAP server with administrative dn "%s" and given administrative password (anonymous if user dn is blank)', $dn), Log::DEBUG, $logcategory); $ldap->bind($dn, $this->params->get('password', '')); } catch (ConnectionException | LdapException $exception) { $response->status = Authentication::STATUS_FAILURE; @@ -174,7 +174,7 @@ public function onUserAuthenticate(AuthenticationEvent $event): void str_replace(';', '\3b', $ldap->escape($credentials['username'], '', LDAP_ESCAPE_FILTER)), $this->params->get('search_string', '') ); - Log::add(sprintf('Searching LDAP entry with filter: "%s"', $searchstring), Log::DEBUG, $logcategory); + Log::add(\sprintf('Searching LDAP entry with filter: "%s"', $searchstring), Log::DEBUG, $logcategory); $entry = $this->searchByString($searchstring, $ldap); } catch (LdapException $exception) { $response->status = Authentication::STATUS_FAILURE; @@ -193,11 +193,11 @@ public function onUserAuthenticate(AuthenticationEvent $event): void return; } - Log::add(sprintf('LDAP entry found at "%s"', $entry->getDn()), Log::DEBUG, $logcategory); + Log::add(\sprintf('LDAP entry found at "%s"', $entry->getDn()), Log::DEBUG, $logcategory); try { // Verify Users Credentials - Log::add(sprintf('Binding to LDAP server with found user dn "%s" and user entered password', $entry->getDn()), Log::DEBUG, $logcategory); + Log::add(\sprintf('Binding to LDAP server with found user dn "%s" and user entered password', $entry->getDn()), Log::DEBUG, $logcategory); $ldap->bind($entry->getDn(), $credentials['password']); } catch (ConnectionException $exception) { $response->status = Authentication::STATUS_FAILURE; @@ -222,7 +222,7 @@ public function onUserAuthenticate(AuthenticationEvent $event): void ); } - Log::add(sprintf('Direct binding to LDAP server with entered user dn "%s" and user entered password', $dn), Log::DEBUG, $logcategory); + Log::add(\sprintf('Direct binding to LDAP server with entered user dn "%s" and user entered password', $dn), Log::DEBUG, $logcategory); $ldap->bind($dn, $credentials['password']); } catch (ConnectionException | LdapException $exception) { $response->status = Authentication::STATUS_FAILURE; @@ -238,7 +238,7 @@ public function onUserAuthenticate(AuthenticationEvent $event): void str_replace(';', '\3b', $ldap->escape($credentials['username'], '', LDAP_ESCAPE_FILTER)), $this->params->get('search_string', '') ); - Log::add(sprintf('Searching LDAP entry with filter: "%s"', $searchstring), Log::DEBUG, $logcategory); + Log::add(\sprintf('Searching LDAP entry with filter: "%s"', $searchstring), Log::DEBUG, $logcategory); $entry = $this->searchByString($searchstring, $ldap); } catch (LdapException $exception) { $response->status = Authentication::STATUS_FAILURE; @@ -257,7 +257,7 @@ public function onUserAuthenticate(AuthenticationEvent $event): void return; } - Log::add(sprintf('LDAP entry found at "%s"', $entry->getDn()), Log::DEBUG, $logcategory); + Log::add(\sprintf('LDAP entry found at "%s"', $entry->getDn()), Log::DEBUG, $logcategory); break; @@ -276,7 +276,7 @@ public function onUserAuthenticate(AuthenticationEvent $event): void $response->fullname = $entry->getAttribute($ldap_fullname)[0] ?? $credentials['username']; // Were good - So say so. - Log::add(sprintf('LDAP login succeeded; username: "%s", email: "%s", fullname: "%s"', $response->username, $response->email, $response->fullname), Log::DEBUG, $logcategory); + Log::add(\sprintf('LDAP login succeeded; username: "%s", email: "%s", fullname: "%s"', $response->username, $response->email, $response->fullname), Log::DEBUG, $logcategory); $response->status = Authentication::STATUS_SUCCESS; $response->error_message = ''; diff --git a/plugins/content/joomla/src/Extension/Joomla.php b/plugins/content/joomla/src/Extension/Joomla.php index 58d3d197b7a78..3aa4e99608b82 100644 --- a/plugins/content/joomla/src/Extension/Joomla.php +++ b/plugins/content/joomla/src/Extension/Joomla.php @@ -144,7 +144,7 @@ public function onContentAfterSave($context, $article, $isNew): void $message = [ 'user_id_to' => $user_id, 'subject' => $lang->_('COM_CONTENT_NEW_ARTICLE'), - 'message' => sprintf($lang->_('COM_CONTENT_ON_NEW_CONTENT'), $user->name, $article->title), + 'message' => \sprintf($lang->_('COM_CONTENT_ON_NEW_CONTENT'), $user->name, $article->title), ]; $model_message = $this->getApplication()->bootComponent('com_messages')->getMVCFactory() ->createModel('Message', 'Administrator'); diff --git a/plugins/extension/finder/src/Extension/Finder.php b/plugins/extension/finder/src/Extension/Finder.php index 16ef01c32cfb2..05acb5071e935 100644 --- a/plugins/extension/finder/src/Extension/Finder.php +++ b/plugins/extension/finder/src/Extension/Finder.php @@ -39,7 +39,7 @@ final class Finder extends CMSPlugin implements SubscriberInterface * * @return array * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ public static function getSubscribedEvents(): array { diff --git a/plugins/extension/joomla/src/Extension/Joomla.php b/plugins/extension/joomla/src/Extension/Joomla.php index b98e8f8c8e875..48c30a1a2df5b 100644 --- a/plugins/extension/joomla/src/Extension/Joomla.php +++ b/plugins/extension/joomla/src/Extension/Joomla.php @@ -61,7 +61,7 @@ final class Joomla extends CMSPlugin implements SubscriberInterface * * @return array * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ public static function getSubscribedEvents(): array { diff --git a/plugins/extension/namespacemap/src/Extension/NamespaceMap.php b/plugins/extension/namespacemap/src/Extension/NamespaceMap.php index c5e60266ad6c7..aa3fe2613ce26 100644 --- a/plugins/extension/namespacemap/src/Extension/NamespaceMap.php +++ b/plugins/extension/namespacemap/src/Extension/NamespaceMap.php @@ -58,7 +58,7 @@ public function __construct(DispatcherInterface $dispatcher, \JNamespacePsr4Map * * @return array * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ public static function getSubscribedEvents(): array { diff --git a/plugins/finder/categories/src/Extension/Categories.php b/plugins/finder/categories/src/Extension/Categories.php index 1f02269d919f6..d478fddcc75a2 100644 --- a/plugins/finder/categories/src/Extension/Categories.php +++ b/plugins/finder/categories/src/Extension/Categories.php @@ -96,7 +96,7 @@ final class Categories extends Adapter implements SubscriberInterface * * @return array * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ public static function getSubscribedEvents(): array { diff --git a/plugins/finder/contacts/src/Extension/Contacts.php b/plugins/finder/contacts/src/Extension/Contacts.php index 7c517290cb035..71759b965dd0c 100644 --- a/plugins/finder/contacts/src/Extension/Contacts.php +++ b/plugins/finder/contacts/src/Extension/Contacts.php @@ -96,7 +96,7 @@ final class Contacts extends Adapter implements SubscriberInterface * * @return array * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ public static function getSubscribedEvents(): array { diff --git a/plugins/finder/newsfeeds/src/Extension/Newsfeeds.php b/plugins/finder/newsfeeds/src/Extension/Newsfeeds.php index 9105582877abb..120476d9b3279 100644 --- a/plugins/finder/newsfeeds/src/Extension/Newsfeeds.php +++ b/plugins/finder/newsfeeds/src/Extension/Newsfeeds.php @@ -96,7 +96,7 @@ final class Newsfeeds extends Adapter implements SubscriberInterface * * @return array * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ public static function getSubscribedEvents(): array { diff --git a/plugins/finder/tags/src/Extension/Tags.php b/plugins/finder/tags/src/Extension/Tags.php index 28709a8272236..d75848e0ea582 100644 --- a/plugins/finder/tags/src/Extension/Tags.php +++ b/plugins/finder/tags/src/Extension/Tags.php @@ -96,7 +96,7 @@ final class Tags extends Adapter implements SubscriberInterface * * @return array * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ public static function getSubscribedEvents(): array { diff --git a/plugins/installer/override/src/Extension/Override.php b/plugins/installer/override/src/Extension/Override.php index e2a10231d58d1..6cf60631e1d96 100644 --- a/plugins/installer/override/src/Extension/Override.php +++ b/plugins/installer/override/src/Extension/Override.php @@ -44,7 +44,7 @@ final class Override extends CMSPlugin implements SubscriberInterface * * @return array * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ public static function getSubscribedEvents(): array { diff --git a/plugins/media-action/resize/src/Extension/Resize.php b/plugins/media-action/resize/src/Extension/Resize.php index e3218ca98d5f8..38030498de15a 100644 --- a/plugins/media-action/resize/src/Extension/Resize.php +++ b/plugins/media-action/resize/src/Extension/Resize.php @@ -31,7 +31,7 @@ final class Resize extends MediaActionPlugin implements SubscriberInterface * * @return array * - * @since __DEPLOY_VERSION__ + * @since 5.2.0 */ public static function getSubscribedEvents(): array { diff --git a/plugins/multifactorauth/totp/src/Extension/Totp.php b/plugins/multifactorauth/totp/src/Extension/Totp.php index ab483317b6768..acfd42e9cc0ce 100644 --- a/plugins/multifactorauth/totp/src/Extension/Totp.php +++ b/plugins/multifactorauth/totp/src/Extension/Totp.php @@ -210,7 +210,7 @@ public function onUserMultifactorGetSetup(GetSetup $event): void // Generate a QR code for the key $user = $this->getUserFactory()->loadUserById($record->user_id); $hostname = Uri::getInstance()->toString(['host']); - $otpURL = sprintf("otpauth://totp/%s@%s?secret=%s", $user->username, $hostname, $key); + $otpURL = \sprintf("otpauth://totp/%s@%s?secret=%s", $user->username, $hostname, $key); $document = $this->getApplication()->getDocument(); $wam = $document->getWebAssetManager(); diff --git a/plugins/multifactorauth/webauthn/src/Helper/Credentials.php b/plugins/multifactorauth/webauthn/src/Helper/Credentials.php index b03628b25c410..c9a8026199859 100644 --- a/plugins/multifactorauth/webauthn/src/Helper/Credentials.php +++ b/plugins/multifactorauth/webauthn/src/Helper/Credentials.php @@ -239,7 +239,7 @@ private static function getAvatar(User $user, int $size = 64) $scheme = Uri::getInstance()->getScheme(); $subdomain = ($scheme == 'https') ? 'secure' : 'www'; - return sprintf('%s://%s.gravatar.com/avatar/%s.jpg?s=%u&d=mm', $scheme, $subdomain, md5($user->email), $size); + return \sprintf('%s://%s.gravatar.com/avatar/%s.jpg?s=%u&d=mm', $scheme, $subdomain, md5($user->email), $size); } /** diff --git a/plugins/quickicon/eos/src/Extension/Eos.php b/plugins/quickicon/eos/src/Extension/Eos.php index c6c361c04c3cf..f87c5fccbaf0e 100644 --- a/plugins/quickicon/eos/src/Extension/Eos.php +++ b/plugins/quickicon/eos/src/Extension/Eos.php @@ -112,7 +112,7 @@ public function getEndOfServiceNotification(QuickIconsEvent $event): void // Show this only when not snoozed if ($this->params->get('last_snoozed_id', 0) < $this->currentMessage['id']) { // Build the message to be displayed in the cpanel - $messageText = sprintf( + $messageText = \sprintf( $app->getLanguage()->_($this->currentMessage['messageText']), HTMLHelper::_('date', Eos::EOS_DATE, $app->getLanguage()->_('DATE_FORMAT_LC3')), $this->currentMessage['messageLink'] diff --git a/plugins/sampledata/blog/src/Extension/Blog.php b/plugins/sampledata/blog/src/Extension/Blog.php index 68138976df258..53f9529987c21 100644 --- a/plugins/sampledata/blog/src/Extension/Blog.php +++ b/plugins/sampledata/blog/src/Extension/Blog.php @@ -427,12 +427,12 @@ public function onAjaxSampledataApplyStep1() ]; // Create Transitions. - for ($i = 0; $i < \count($fromTo); $i++) { + foreach ($fromTo as $i => $item) { $trTable = new \Joomla\Component\Workflow\Administrator\Table\TransitionTable($this->getDatabase()); - $trTable->from_stage_id = $fromTo[$i]['from_stage_id']; - $trTable->to_stage_id = $fromTo[$i]['to_stage_id']; - $trTable->options = $fromTo[$i]['options']; + $trTable->from_stage_id = $item['from_stage_id']; + $trTable->to_stage_id = $item['to_stage_id']; + $trTable->options = $item['options']; // Set values from language strings. $trTable->title = $this->getApplication()->getLanguage()->_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_TRANSITION' . ($i + 1) . '_TITLE'); diff --git a/plugins/system/debug/src/Extension/Debug.php b/plugins/system/debug/src/Extension/Debug.php index e17756cf82ad6..3f98f0409d778 100644 --- a/plugins/system/debug/src/Extension/Debug.php +++ b/plugins/system/debug/src/Extension/Debug.php @@ -210,7 +210,7 @@ public function __construct(DispatcherInterface $dispatcher, array $config, CMSA if ($this->showLogs && $this->getApplication()->get('log_deprecated')) { foreach (\JLoader::getDeprecatedAliases() as $deprecation) { Log::add( - sprintf( + \sprintf( '%1$s has been aliased to %2$s and the former class name is deprecated. The alias will be removed in %3$s.', $deprecation['old'], $deprecation['new'], @@ -691,7 +691,7 @@ public function onBeforeRespond(): void $desc = str_ireplace('after', '', $mark->label); $name = preg_replace('/[^\da-z]/i', '', $desc); - $metrics .= sprintf('%s;dur=%f;desc="%s", ', $index . $name, $mark->time, $desc); + $metrics .= \sprintf('%s;dur=%f;desc="%s", ', $index . $name, $mark->time, $desc); // Do not create too large headers, some web servers don't love them if (\strlen($metrics) > 3000) { diff --git a/plugins/system/debug/src/JavascriptRenderer.php b/plugins/system/debug/src/JavascriptRenderer.php index f67b8127c23d0..d2daeea496bd9 100644 --- a/plugins/system/debug/src/JavascriptRenderer.php +++ b/plugins/system/debug/src/JavascriptRenderer.php @@ -60,15 +60,15 @@ public function renderHead() $doc = Factory::getApplication()->getDocument(); foreach ($cssFiles as $file) { - $html .= sprintf('' . "\n", $file); + $html .= \sprintf('' . "\n", $file); } foreach ($inlineCss as $content) { - $html .= sprintf('' . "\n", $content); + $html .= \sprintf('' . "\n", $content); } foreach ($jsFiles as $file) { - $html .= sprintf('' . "\n", $file); + $html .= \sprintf('' . "\n", $file); } $nonce = ''; @@ -78,7 +78,7 @@ public function renderHead() } foreach ($inlineJs as $content) { - $html .= sprintf('' . "\n", $nonce, $content); + $html .= \sprintf('' . "\n", $nonce, $content); } foreach ($inlineHead as $content) { diff --git a/plugins/system/guidedtours/src/Extension/GuidedTours.php b/plugins/system/guidedtours/src/Extension/GuidedTours.php index 76844f7d61811..fe254dd300269 100644 --- a/plugins/system/guidedtours/src/Extension/GuidedTours.php +++ b/plugins/system/guidedtours/src/Extension/GuidedTours.php @@ -326,13 +326,15 @@ private function processTour($item) $temp->id = 0; $temp->title = $this->getApplication()->getLanguage()->_($item->title); $temp->description = $this->getApplication()->getLanguage()->_($item->description); + $temp->description = $this->fixImagePaths($temp->description); $temp->url = $item->url; - // Replace 'images/' to '../images/' when using an image from /images in backend. - $temp->description = preg_replace('*src\=\"(?!administrator\/)images/*', 'src="../images/', $temp->description); - // Set the start label for the tour. $temp->start_label = Text::_('PLG_SYSTEM_GUIDEDTOURS_START'); + // What's new tours have a different label. + if (str_contains($item->uid, 'joomla-whatsnew')) { + $temp->start_label = Text::_('PLG_SYSTEM_GUIDEDTOURS_NEXT'); + } $tour->steps[] = $temp; @@ -342,6 +344,7 @@ private function processTour($item) $temp->id = $i + 1; $temp->title = $this->getApplication()->getLanguage()->_($step->title); $temp->description = $this->getApplication()->getLanguage()->_($step->description); + $temp->description = $this->fixImagePaths($temp->description); $temp->position = $step->position; $temp->target = $step->target; $temp->type = $this->stepType[$step->type]; @@ -351,12 +354,33 @@ private function processTour($item) $temp->tour_id = $step->tour_id; $temp->step_id = $step->id; - // Replace 'images/' to '../images/' when using an image from /images in backend. - $temp->description = preg_replace('*src\=\"(?!administrator\/)images/*', 'src="../images/', $temp->description); - $tour->steps[] = $temp; } return $tour; } + + /** + * Return a modified version of a given string with usable image paths for tours + * + * @param string $description The string to fix + * + * @return string + * + * @since __DEPLOY_VERSION__ + */ + private function fixImagePaths($description) + { + return preg_replace( + [ + '*src="(?!administrator\/)images/*', + '*src="media/*', + ], + [ + 'src="../images/', + 'src="../media/', + ], + $description + ); + } } diff --git a/plugins/system/remember/src/Extension/Remember.php b/plugins/system/remember/src/Extension/Remember.php index bf626d11e95a6..3956f750b9104 100644 --- a/plugins/system/remember/src/Extension/Remember.php +++ b/plugins/system/remember/src/Extension/Remember.php @@ -119,7 +119,7 @@ public function onUserBeforeSave($user, $isnew, $data) } catch (\RuntimeException $e) { // Log an alert for the site admin Log::add( - sprintf('Failed to delete cookie token for user %s with the following error: %s', $user['username'], $e->getMessage()), + \sprintf('Failed to delete cookie token for user %s with the following error: %s', $user['username'], $e->getMessage()), Log::WARNING, 'security' ); diff --git a/plugins/system/webauthn/src/Authentication.php b/plugins/system/webauthn/src/Authentication.php index 240b5c46bab35..c8b12f620ad5a 100644 --- a/plugins/system/webauthn/src/Authentication.php +++ b/plugins/system/webauthn/src/Authentication.php @@ -323,7 +323,7 @@ public function validateAttestationResponse(string $data): PublicKeyCredentialSo $myUserId = $myUser->id; if (($myUser->guest) || ($myUserId != $storedUserId)) { - $message = sprintf('Invalid user! We asked the authenticator to attest user ID %d, the current user ID is %d', $storedUserId, $myUserId); + $message = \sprintf('Invalid user! We asked the authenticator to attest user ID %d, the current user ID is %d', $storedUserId, $myUserId); Log::add($message, Log::NOTICE, 'webauthn.system'); throw new \RuntimeException(Text::_('PLG_SYSTEM_WEBAUTHN_ERR_CREATE_INVALID_USER')); @@ -452,7 +452,7 @@ private function getAvatar(User $user, int $size = 64) $scheme = Uri::getInstance()->getScheme(); $subdomain = ($scheme == 'https') ? 'secure' : 'www'; - return sprintf('%s://%s.gravatar.com/avatar/%s.jpg?s=%u&d=mm', $scheme, $subdomain, md5($user->email), $size); + return \sprintf('%s://%s.gravatar.com/avatar/%s.jpg?s=%u&d=mm', $scheme, $subdomain, md5($user->email), $size); } /** diff --git a/plugins/system/webauthn/src/CredentialRepository.php b/plugins/system/webauthn/src/CredentialRepository.php index 6e20e2822c111..e23a3e34f0870 100644 --- a/plugins/system/webauthn/src/CredentialRepository.php +++ b/plugins/system/webauthn/src/CredentialRepository.php @@ -430,7 +430,7 @@ public function getUserHandleFor(string $credentialId): string public function getHandleFromUserId(int $id): string { $key = $this->getEncryptionKey(); - $data = sprintf('%010u', $id); + $data = \sprintf('%010u', $id); return hash_hmac('sha256', $data, $key, false); } @@ -510,7 +510,7 @@ public function getUserIdFromHandle(?string $userHandle): ?int } foreach ($ids as $userId) { - $data = sprintf('%010u', $userId); + $data = \sprintf('%010u', $userId); $thisHandle = hash_hmac('sha256', $data, $key, false); if ($thisHandle == $userHandle) { diff --git a/plugins/system/webauthn/src/PluginTraits/AjaxHandlerLogin.php b/plugins/system/webauthn/src/PluginTraits/AjaxHandlerLogin.php index 97d75d770f74a..f4d339256e63c 100644 --- a/plugins/system/webauthn/src/PluginTraits/AjaxHandlerLogin.php +++ b/plugins/system/webauthn/src/PluginTraits/AjaxHandlerLogin.php @@ -67,7 +67,7 @@ public function onAjaxWebauthnLogin(AjaxLogin $event): void $user = Factory::getContainer()->get(UserFactoryInterface::class)->loadUserById($userId); if ($user->id != $userId) { - $message = sprintf('User #%d does not exist', $userId); + $message = \sprintf('User #%d does not exist', $userId); Log::add($message, Log::NOTICE, 'webauthn.system'); throw new \RuntimeException(Text::_('PLG_SYSTEM_WEBAUTHN_ERR_CREATE_INVALID_LOGIN_REQUEST')); @@ -86,7 +86,7 @@ public function onAjaxWebauthnLogin(AjaxLogin $event): void $validUserHandle = $credentialRepository->getHandleFromUserId($userId); if ($userHandle != $validUserHandle) { - $message = sprintf('Invalid user handle; expected %s, got %s', $validUserHandle, $userHandle); + $message = \sprintf('Invalid user handle; expected %s, got %s', $validUserHandle, $userHandle); Log::add($message, Log::NOTICE, 'webauthn.system'); throw new \RuntimeException(Text::_('PLG_SYSTEM_WEBAUTHN_ERR_CREATE_INVALID_LOGIN_REQUEST')); @@ -96,7 +96,7 @@ public function onAjaxWebauthnLogin(AjaxLogin $event): void $user = Factory::getContainer()->get(UserFactoryInterface::class)->loadUserById($userId); if ($user->id != $userId) { - $message = sprintf('Invalid user ID; expected %d, got %d', $userId, $user->id); + $message = \sprintf('Invalid user ID; expected %d, got %d', $userId, $user->id); Log::add($message, Log::NOTICE, 'webauthn.system'); throw new \RuntimeException(Text::_('PLG_SYSTEM_WEBAUTHN_ERR_CREATE_INVALID_LOGIN_REQUEST')); @@ -112,7 +112,7 @@ public function onAjaxWebauthnLogin(AjaxLogin $event): void $response->status = Authentication::STATUS_UNKNOWN; $response->error_message = $e->getMessage(); - Log::add(sprintf("Received login failure. Message: %s", $e->getMessage()), Log::ERROR, 'webauthn.system'); + Log::add(\sprintf("Received login failure. Message: %s", $e->getMessage()), Log::ERROR, 'webauthn.system'); // This also enqueues the login failure message for display after redirection. Look for JLog in that method. $this->processLoginFailure($response); @@ -197,11 +197,19 @@ class_exists('Joomla\\CMS\\Authentication\\Authentication', true); } // Run the user plugins. They CAN block login by returning boolean false and setting $response->error_message. - PluginHelper::importPlugin('user'); - $eventClassName = self::getEventClassByEventName('onUserLogin'); - $event = new $eventClassName('onUserLogin', [(array) $response, $options]); - $result = $this->getApplication()->getDispatcher()->dispatch($event->getName(), $event); - $results = !isset($result['result']) || \is_null($result['result']) ? [] : $result['result']; + $dispatcher = $this->getApplication()->getDispatcher(); + + PluginHelper::importPlugin('user', null, true, $dispatcher); + + $event = new \Joomla\CMS\Event\User\LoginEvent( + 'onUserLogin', + [ + 'options' => $options, + 'subject' => (array) $response, + ] + ); + $result = $dispatcher->dispatch('onUserLogin', $event); + $results = !isset($result['result']) || \is_null($result['result']) ? [] : $result['result']; // If there is no boolean FALSE result from any plugin the login is successful. if (\in_array(false, $results, true) === false) { @@ -213,17 +221,27 @@ class_exists('Joomla\\CMS\\Authentication\\Authentication', true); $options['responseType'] = $response->type; // The user is successfully logged in. Run the after login events - $eventClassName = self::getEventClassByEventName('onUserAfterLogin'); - $event = new $eventClassName('onUserAfterLogin', [$options]); - $this->getApplication()->getDispatcher()->dispatch($event->getName(), $event); + $event = new \Joomla\CMS\Event\User\AfterLoginEvent( + 'onUserAfterLogin', + [ + 'options' => $options, + 'subject' => (array) $response, + ] + ); + $dispatcher->dispatch($event->getName(), $event); return; } // If we are here the plugins marked a login failure. Trigger the onUserLoginFailure Event. - $eventClassName = self::getEventClassByEventName('onUserLoginFailure'); - $event = new $eventClassName('onUserLoginFailure', [(array) $response]); - $this->getApplication()->getDispatcher()->dispatch($event->getName(), $event); + $event = new \Joomla\CMS\Event\User\LoginFailureEvent( + 'onUserLoginFailure', + [ + 'options' => $options, + 'subject' => (array) $response, + ] + ); + $dispatcher->dispatch('onUserLoginFailure', $event); // Log the failure Log::add($response->error_message, Log::WARNING, 'jerror'); diff --git a/plugins/task/checkfiles/src/Extension/Checkfiles.php b/plugins/task/checkfiles/src/Extension/Checkfiles.php index 51649a0d01500..7c1ab16a9cbe0 100644 --- a/plugins/task/checkfiles/src/Extension/Checkfiles.php +++ b/plugins/task/checkfiles/src/Extension/Checkfiles.php @@ -130,7 +130,7 @@ protected function checkImages(ExecuteTaskEvent $event): int $newHeight = $dimension === 'height' ? $limit : $height * $limit / $width; $newWidth = $dimension === 'width' ? $limit : $width * $limit / $height; - $this->logTask(sprintf( + $this->logTask(\sprintf( $this->getApplication()->getLanguage()->_('PLG_TASK_CHECK_FILES_LOG_RESIZING_IMAGE'), $width, $height, diff --git a/plugins/task/deleteactionlogs/src/Extension/DeleteActionLogs.php b/plugins/task/deleteactionlogs/src/Extension/DeleteActionLogs.php index 21c4be6c83a6b..1b756739ca27c 100644 --- a/plugins/task/deleteactionlogs/src/Extension/DeleteActionLogs.php +++ b/plugins/task/deleteactionlogs/src/Extension/DeleteActionLogs.php @@ -78,7 +78,7 @@ public static function getSubscribedEvents(): array private function deleteLogs(ExecuteTaskEvent $event): int { $daysToDeleteAfter = (int) $event->getArgument('params')->logDeletePeriod ?? 0; - $this->logTask(sprintf('Delete Logs after %d days', $daysToDeleteAfter)); + $this->logTask(\sprintf('Delete Logs after %d days', $daysToDeleteAfter)); $now = Factory::getDate()->toSql(); $db = $this->getDatabase(); $query = $db->getQuery(true); diff --git a/plugins/task/requests/src/Extension/Requests.php b/plugins/task/requests/src/Extension/Requests.php index a70fba520954c..606d1d9a00b9a 100644 --- a/plugins/task/requests/src/Extension/Requests.php +++ b/plugins/task/requests/src/Extension/Requests.php @@ -158,7 +158,7 @@ protected function makeGetRequest(ExecuteTaskEvent $event): int > Response: $responseStatus EOF; - $this->logTask(sprintf($this->getApplication()->getLanguage()->_('PLG_TASK_REQUESTS_TASK_GET_REQUEST_LOG_RESPONSE'), $responseCode)); + $this->logTask(\sprintf($this->getApplication()->getLanguage()->_('PLG_TASK_REQUESTS_TASK_GET_REQUEST_LOG_RESPONSE'), $responseCode)); if ($response->code !== 200) { return TaskStatus::KNOCKOUT; diff --git a/plugins/task/sitestatus/src/Extension/SiteStatus.php b/plugins/task/sitestatus/src/Extension/SiteStatus.php index d28b5cae6ed0a..da446799f2282 100644 --- a/plugins/task/sitestatus/src/Extension/SiteStatus.php +++ b/plugins/task/sitestatus/src/Extension/SiteStatus.php @@ -142,7 +142,7 @@ public function alterSiteStatus(ExecuteTaskEvent $event): void $newStatus = $config['offline'] ? 'offline' : 'online'; $exit = $this->writeConfigFile(new Registry($config)); - $this->logTask(sprintf($this->getApplication()->getLanguage()->_('PLG_TASK_SITE_STATUS_TASK_LOG_SITE_STATUS'), $oldStatus, $newStatus)); + $this->logTask(\sprintf($this->getApplication()->getLanguage()->_('PLG_TASK_SITE_STATUS_TASK_LOG_SITE_STATUS'), $oldStatus, $newStatus)); $this->endRoutine($event, $exit); } diff --git a/plugins/workflow/notification/src/Extension/Notification.php b/plugins/workflow/notification/src/Extension/Notification.php index 042eda6110f8b..ff8d83a053fe7 100644 --- a/plugins/workflow/notification/src/Extension/Notification.php +++ b/plugins/workflow/notification/src/Extension/Notification.php @@ -210,7 +210,7 @@ public function onWorkflowAfterTransition(WorkflowTransitionEvent $event) // Load language for messaging $lang = $this->languageFactory->createLanguage($user->getParam('admin_language', $defaultLanguage), $debug); $lang->load('plg_workflow_notification'); - $messageText = sprintf( + $messageText = \sprintf( $lang->_('PLG_WORKFLOW_NOTIFICATION_ON_TRANSITION_MSG'), $title, $lang->_($transitionName), @@ -225,7 +225,7 @@ public function onWorkflowAfterTransition(WorkflowTransitionEvent $event) $message = [ 'id' => 0, 'user_id_to' => $receiver->id, - 'subject' => sprintf($lang->_('PLG_WORKFLOW_NOTIFICATION_ON_TRANSITION_SUBJECT'), $title), + 'subject' => \sprintf($lang->_('PLG_WORKFLOW_NOTIFICATION_ON_TRANSITION_SUBJECT'), $title), 'message' => $messageText, ]; diff --git a/tests/System/integration/administrator/components/com_actionlogs/Actionlogs.cy.js b/tests/System/integration/administrator/components/com_actionlogs/Actionlogs.cy.js index eebdcf55962c0..8fbd3ef065474 100644 --- a/tests/System/integration/administrator/components/com_actionlogs/Actionlogs.cy.js +++ b/tests/System/integration/administrator/components/com_actionlogs/Actionlogs.cy.js @@ -5,7 +5,7 @@ describe('Test in backend that the action logs', () => { cy.visit('/administrator/index.php?option=com_actionlogs&view=actionlogs'); }); - it('have a title', () => { + it('has a title', () => { cy.get('h1.page-title').should('contain.text', 'User Actions Log'); }); @@ -23,7 +23,7 @@ describe('Test in backend that the action logs', () => { cy.task('queryDB', 'TRUNCATE #__action_logs'); }); - it('have an export button', () => { + it('has an export button', () => { cy.get('#toolbar-download1').click(); cy.get('#system-message-container').contains('There are no User Action logs to export').should('exist'); }); diff --git a/tests/System/integration/administrator/components/com_cache/Default.cy.js b/tests/System/integration/administrator/components/com_cache/Default.cy.js index 218fa196780e4..74fc19891d532 100644 --- a/tests/System/integration/administrator/components/com_cache/Default.cy.js +++ b/tests/System/integration/administrator/components/com_cache/Default.cy.js @@ -4,7 +4,7 @@ describe('Test in backend that the cache', () => { cy.visit('/administrator/index.php?option=com_cache&view=cache'); }); - it('have a title', () => { + it('has a title', () => { cy.get('h1.page-title').should('contain.text', 'Maintenance: Clear Cache'); }); diff --git a/tests/System/integration/administrator/components/com_checkin/Default.cy.js b/tests/System/integration/administrator/components/com_checkin/Default.cy.js index c426e9b3f73fb..406426772a328 100644 --- a/tests/System/integration/administrator/components/com_checkin/Default.cy.js +++ b/tests/System/integration/administrator/components/com_checkin/Default.cy.js @@ -12,7 +12,7 @@ describe('Test in backend that the checkin', () => { cy.get('p.lead').should('contain.text', 'There are no tables with checked out items'); }); - it('can display a list of checked out', () => { + it('can display a list of checked out items', () => { cy.db_createArticle({ title: 'Test article', checked_out: '1', checked_out_time: '2024-01-01 20:00:00' }).then(() => { cy.visit('/administrator/index.php?option=com_checkin'); cy.get('tr.row0').should('contain.text', 'content'); diff --git a/tests/System/integration/administrator/components/com_login/Login.cy.js b/tests/System/integration/administrator/components/com_login/Login.cy.js index 78f40b249ee3d..f7f999f54b09e 100644 --- a/tests/System/integration/administrator/components/com_login/Login.cy.js +++ b/tests/System/integration/administrator/components/com_login/Login.cy.js @@ -36,7 +36,7 @@ describe('Test in backend that the login component', () => { cy.get('#system-message-container').contains('Username and password do not match or you do not have an account yet.').should('exist'); }); - it('can not log in with not existing user', () => { + it('can not log in with non-existing user', () => { cy.visit('administrator/index.php'); cy.get('#mod-login-username').type('invalid'); cy.get('#mod-login-password').type('invalid'); diff --git a/tests/System/integration/administrator/components/com_privacy/Consent.cy.js b/tests/System/integration/administrator/components/com_privacy/Consent.cy.js index 772cc5092c2eb..0b1d03f53c647 100644 --- a/tests/System/integration/administrator/components/com_privacy/Consent.cy.js +++ b/tests/System/integration/administrator/components/com_privacy/Consent.cy.js @@ -1,4 +1,4 @@ -describe('Test in backend that privacy consent component', () => { +describe('Test in backend that the privacy consent component', () => { beforeEach(() => cy.doAdministratorLogin()); afterEach(() => { cy.task('queryDB', 'DELETE FROM #__privacy_consents'); diff --git a/tests/System/plugins/db.mjs b/tests/System/plugins/db.mjs index 7fbdacd972e0a..a92065c07e6a5 100644 --- a/tests/System/plugins/db.mjs +++ b/tests/System/plugins/db.mjs @@ -35,7 +35,6 @@ function queryTestDB(joomlaQuery, config) { // Do we use PostgreSQL? if (config.env.db_type === 'pgsql' || config.env.db_type === 'PostgreSQL (PDO)') { - if (postgresConnectionPool === null) { // Initialisation on the first call postgresConnectionPool = postgres({ diff --git a/tests/System/plugins/fs.mjs b/tests/System/plugins/fs.mjs index 819d285eb33ea..ae4d35c8da78f 100644 --- a/tests/System/plugins/fs.mjs +++ b/tests/System/plugins/fs.mjs @@ -1,5 +1,7 @@ -import { chmodSync, existsSync, writeFileSync, mkdirSync, rmSync } from "fs"; -import { dirname, join } from "path"; +import { + chmodSync, existsSync, writeFileSync, mkdirSync, rmSync, +} from 'fs'; +import { dirname, join } from 'path'; import { umask } from 'node:process'; /** diff --git a/tests/System/plugins/index.mjs b/tests/System/plugins/index.mjs index fff01fe477d04..ab7c8a2b72a5e 100644 --- a/tests/System/plugins/index.mjs +++ b/tests/System/plugins/index.mjs @@ -1,6 +1,6 @@ -import { getMails, clearEmails, startMailServer } from "./mail.mjs"; -import { writeRelativeFile, deleteRelativePath } from "./fs.mjs"; -import { queryTestDB, deleteInsertedItems } from "./db.mjs"; +import { getMails, clearEmails, startMailServer } from './mail.mjs'; +import { writeRelativeFile, deleteRelativePath } from './fs.mjs'; +import { queryTestDB, deleteInsertedItems } from './db.mjs'; /** * Does the setup of the plugins. @@ -21,4 +21,3 @@ export default function setupPlugins(on, config) { startMailServer: () => startMailServer(config), }); } -