From 10f250f418851674c2e4104b6b39b9b665496544 Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Sat, 14 Jan 2023 10:54:47 +0100 Subject: [PATCH] Changes the code base to short array syntax (#39616) --- .../src/Controller/ActionlogsController.php | 4 +- .../src/Field/ExtensionField.php | 2 +- .../src/Field/LogsdaterangeField.php | 4 +- .../src/Field/PlugininfoField.php | 2 +- .../src/Helper/ActionlogsHelper.php | 22 +- .../src/Model/ActionlogModel.php | 6 +- .../src/Model/ActionlogsModel.php | 18 +- .../tmpl/actionlogs/default.php | 2 +- .../com_admin/postinstall/behindproxy.php | 4 +- administrator/components/com_admin/script.php | 20 +- .../src/Controller/DisplayController.php | 2 +- .../com_admin/src/Model/HelpModel.php | 2 +- .../layouts/joomla/searchtools/default.php | 6 +- .../src/Controller/AssociationController.php | 2 +- .../src/Controller/AssociationsController.php | 4 +- .../src/Field/ItemlanguageField.php | 4 +- .../src/Field/ItemtypeField.php | 2 +- .../src/Field/Modal/AssociationField.php | 6 +- .../src/Helper/AssociationsHelper.php | 18 +- .../src/Model/AssociationModel.php | 4 +- .../src/Model/AssociationsModel.php | 10 +- .../src/View/Associations/HtmlView.php | 8 +- .../tmpl/associations/default.php | 8 +- .../tmpl/associations/modal.php | 8 +- .../src/Controller/BannerController.php | 6 +- .../src/Controller/BannersController.php | 8 +- .../src/Controller/ClientsController.php | 2 +- .../src/Controller/DisplayController.php | 2 +- .../src/Controller/TracksController.php | 6 +- .../com_banners/src/Helper/BannersHelper.php | 2 +- .../com_banners/src/Model/BannerModel.php | 10 +- .../com_banners/src/Model/BannersModel.php | 8 +- .../com_banners/src/Model/ClientModel.php | 6 +- .../com_banners/src/Model/ClientsModel.php | 8 +- .../com_banners/src/Model/DownloadModel.php | 8 +- .../com_banners/src/Model/TracksModel.php | 20 +- .../com_banners/src/Service/Html/Banner.php | 16 +- .../com_banners/src/Table/BannerTable.php | 12 +- .../src/Controller/DisplayController.php | 6 +- .../com_cache/src/Model/CacheModel.php | 24 +- .../joomla/form/field/categoryedit.php | 4 +- .../src/Controller/AjaxController.php | 2 +- .../src/Controller/CategoriesController.php | 2 +- .../src/Controller/CategoryController.php | 8 +- .../src/Controller/DisplayController.php | 6 +- .../src/Field/CategoryeditField.php | 4 +- .../src/Field/ComponentsCategoryField.php | 2 +- .../src/Field/Modal/CategoryField.php | 16 +- .../src/Helper/CategoriesHelper.php | 4 +- .../src/Helper/CategoryAssociationHelper.php | 4 +- .../src/Model/CategoriesModel.php | 6 +- .../src/Model/CategoryModel.php | 36 +- .../src/Service/HTML/AdministratorService.php | 2 +- .../src/View/Category/HtmlView.php | 2 +- .../tmpl/categories/default.php | 8 +- .../tmpl/categories/default_batch_body.php | 2 +- .../com_categories/tmpl/categories/modal.php | 8 +- .../src/Controller/DisplayController.php | 4 +- .../com_checkin/src/Model/CheckinModel.php | 12 +- .../com_checkin/tmpl/checkin/default.php | 2 +- .../src/Controller/ApplicationController.php | 4 +- .../src/Controller/ComponentController.php | 2 +- .../src/Controller/DisplayController.php | 4 +- .../src/Controller/RequestController.php | 4 +- .../com_config/src/Field/FiltersField.php | 6 +- .../com_config/src/Helper/ConfigHelper.php | 4 +- .../com_config/src/Model/ApplicationModel.php | 50 +- .../com_config/src/Model/ComponentModel.php | 10 +- .../src/Controller/AjaxController.php | 2 +- .../src/Controller/ContactController.php | 6 +- .../src/Controller/ContactsController.php | 8 +- .../src/Controller/DisplayController.php | 2 +- .../src/Extension/ContactComponent.php | 4 +- .../src/Field/Modal/ContactField.php | 16 +- .../src/Helper/AssociationsHelper.php | 18 +- .../com_contact/src/Model/ContactModel.php | 14 +- .../com_contact/src/Model/ContactsModel.php | 16 +- .../src/Service/HTML/AdministratorService.php | 10 +- .../com_contact/src/Service/HTML/Icon.php | 6 +- .../com_contact/src/Table/ContactTable.php | 10 +- .../com_contact/tmpl/contact/edit.php | 2 +- .../com_contact/tmpl/contacts/default.php | 6 +- .../com_contact/tmpl/contacts/modal.php | 8 +- .../src/Controller/AjaxController.php | 2 +- .../src/Controller/ArticleController.php | 14 +- .../src/Controller/ArticlesController.php | 8 +- .../src/Controller/DisplayController.php | 2 +- .../src/Controller/FeaturedController.php | 4 +- .../src/Event/Model/FeatureEvent.php | 2 +- .../src/Extension/ContentComponent.php | 16 +- .../src/Field/Modal/ArticleField.php | 16 +- .../src/Helper/AssociationsHelper.php | 18 +- .../com_content/src/Model/ArticleModel.php | 28 +- .../com_content/src/Model/ArticlesModel.php | 16 +- .../com_content/src/Model/FeatureModel.php | 2 +- .../com_content/src/Model/FeaturedModel.php | 6 +- .../src/Service/HTML/AdministratorService.php | 2 +- .../com_content/src/Service/HTML/Icon.php | 10 +- .../com_content/tmpl/article/edit.php | 6 +- .../com_content/tmpl/articles/default.php | 6 +- .../com_content/tmpl/articles/modal.php | 8 +- .../com_content/tmpl/featured/default.php | 6 +- .../src/Controller/HistoryController.php | 4 +- .../src/Controller/PreviewController.php | 2 +- .../src/Helper/ContenthistoryHelper.php | 8 +- .../src/Model/CompareModel.php | 14 +- .../src/Model/HistoryModel.php | 10 +- .../src/Model/PreviewModel.php | 6 +- .../src/Controller/DisplayController.php | 2 +- .../com_cpanel/tmpl/cpanel/default.php | 8 +- .../src/Controller/FieldController.php | 8 +- .../src/Controller/FieldsController.php | 2 +- .../src/Controller/GroupController.php | 8 +- .../src/Controller/GroupsController.php | 2 +- .../com_fields/src/Field/FieldLayoutField.php | 24 +- .../com_fields/src/Field/SubfieldsField.php | 2 +- .../com_fields/src/Helper/FieldsHelper.php | 30 +- .../com_fields/src/Model/FieldModel.php | 52 +- .../com_fields/src/Model/FieldsModel.php | 8 +- .../com_fields/src/Model/GroupModel.php | 14 +- .../com_fields/src/Model/GroupsModel.php | 6 +- .../src/Plugin/FieldsListPlugin.php | 4 +- .../com_fields/src/Plugin/FieldsPlugin.php | 6 +- .../com_fields/src/Table/FieldTable.php | 6 +- .../components/com_fields/tmpl/field/edit.php | 10 +- .../com_fields/tmpl/fields/default.php | 6 +- .../tmpl/fields/default_batch_body.php | 6 +- .../com_fields/tmpl/fields/modal.php | 6 +- .../components/com_fields/tmpl/group/edit.php | 10 +- .../com_fields/tmpl/groups/default.php | 6 +- .../tmpl/groups/default_batch_body.php | 2 +- .../src/Controller/DisplayController.php | 2 +- .../src/Controller/FilterController.php | 4 +- .../src/Controller/FiltersController.php | 2 +- .../src/Controller/IndexController.php | 2 +- .../src/Controller/IndexerController.php | 4 +- .../src/Controller/MapsController.php | 2 +- .../com_finder/src/Field/ContentmapField.php | 2 +- .../src/Field/ContenttypesField.php | 2 +- .../com_finder/src/Helper/LanguageHelper.php | 2 +- .../com_finder/src/Indexer/Adapter.php | 2 +- .../com_finder/src/Indexer/Helper.php | 12 +- .../com_finder/src/Indexer/Indexer.php | 22 +- .../com_finder/src/Indexer/Language.php | 2 +- .../com_finder/src/Indexer/Language/El.php | 6 +- .../com_finder/src/Indexer/Language/Zh.php | 2 +- .../com_finder/src/Indexer/Parser.php | 2 +- .../com_finder/src/Indexer/Parser/Html.php | 10 +- .../com_finder/src/Indexer/Parser/Rtf.php | 2 +- .../com_finder/src/Indexer/Query.php | 66 +- .../com_finder/src/Indexer/Result.php | 18 +- .../com_finder/src/Indexer/Taxonomy.php | 8 +- .../com_finder/src/Indexer/Token.php | 4 +- .../com_finder/src/Model/FilterModel.php | 8 +- .../com_finder/src/Model/FiltersModel.php | 6 +- .../com_finder/src/Model/IndexModel.php | 18 +- .../com_finder/src/Model/MapsModel.php | 14 +- .../com_finder/src/Model/SearchesModel.php | 6 +- .../com_finder/src/Service/HTML/Filter.php | 14 +- .../com_finder/src/Service/HTML/Finder.php | 10 +- .../com_finder/src/Service/HTML/Query.php | 4 +- .../com_finder/src/Table/FilterTable.php | 6 +- .../com_finder/tmpl/filter/edit.php | 2 +- .../com_finder/tmpl/filters/default.php | 2 +- .../com_finder/tmpl/index/default.php | 6 +- .../com_finder/tmpl/index/emptystate.php | 4 +- .../com_finder/tmpl/maps/default.php | 2 +- .../com_finder/tmpl/searches/default.php | 2 +- .../src/Controller/DatabaseController.php | 4 +- .../src/Controller/InstallController.php | 2 +- .../src/Controller/ManageController.php | 10 +- .../src/Controller/UpdateController.php | 6 +- .../src/Controller/UpdatesitesController.php | 10 +- .../src/Helper/InstallerHelper.php | 8 +- .../com_installer/src/Model/DatabaseModel.php | 28 +- .../com_installer/src/Model/DiscoverModel.php | 12 +- .../com_installer/src/Model/InstallModel.php | 12 +- .../src/Model/InstallerModel.php | 12 +- .../src/Model/LanguagesModel.php | 8 +- .../com_installer/src/Model/ManageModel.php | 40 +- .../com_installer/src/Model/UpdateModel.php | 26 +- .../com_installer/src/Service/HTML/Manage.php | 16 +- .../src/Service/HTML/Updatesites.php | 12 +- .../src/View/Database/HtmlView.php | 4 +- .../com_installer/tmpl/database/default.php | 2 +- .../com_installer/tmpl/discover/default.php | 2 +- .../com_installer/tmpl/languages/default.php | 2 +- .../com_installer/tmpl/manage/default.php | 6 +- .../com_installer/tmpl/update/default.php | 6 +- .../tmpl/updatesites/default.php | 2 +- .../src/Controller/UpdateController.php | 30 +- .../src/Model/UpdateModel.php | 48 +- .../tmpl/joomlaupdate/preupdatecheck.php | 24 +- .../src/Controller/LanguagesController.php | 2 +- .../src/Controller/OverrideController.php | 4 +- .../src/Controller/OverridesController.php | 2 +- .../src/Field/LanguageclientField.php | 4 +- .../src/Model/InstalledModel.php | 16 +- .../com_languages/src/Model/LanguageModel.php | 24 +- .../src/Model/LanguagesModel.php | 6 +- .../com_languages/src/Model/OverrideModel.php | 12 +- .../src/Model/OverridesModel.php | 8 +- .../com_languages/src/Model/StringsModel.php | 4 +- .../src/Service/HTML/Languages.php | 6 +- .../com_languages/tmpl/installed/default.php | 2 +- .../com_languages/tmpl/languages/default.php | 4 +- .../com_languages/tmpl/overrides/default.php | 2 +- .../src/Controller/DisplayController.php | 6 +- .../com_login/src/Model/LoginModel.php | 10 +- .../com_login/tmpl/login/default.php | 4 +- .../src/Controller/DisplayController.php | 2 +- .../src/Controller/TemplateController.php | 16 +- .../com_mails/src/Helper/MailsHelper.php | 4 +- .../com_mails/src/Model/TemplateModel.php | 22 +- .../com_mails/src/Model/TemplatesModel.php | 8 +- .../com_mails/src/Table/TemplateTable.php | 2 +- .../com_mails/src/View/Template/HtmlView.php | 4 +- .../com_mails/tmpl/templates/default.php | 4 +- .../src/Event/FetchMediaItemEvent.php | 2 +- .../src/Event/FetchMediaItemUrlEvent.php | 2 +- .../src/Event/FetchMediaItemsEvent.php | 2 +- .../layouts/joomla/menu/edit_modules.php | 16 +- .../layouts/joomla/searchtools/default.php | 6 +- .../src/Controller/AjaxController.php | 4 +- .../src/Controller/ItemController.php | 34 +- .../src/Controller/ItemsController.php | 12 +- .../src/Controller/MenuController.php | 4 +- .../src/Controller/MenusController.php | 4 +- .../src/Field/MenuItemByTypeField.php | 14 +- .../com_menus/src/Field/MenuOrderingField.php | 6 +- .../com_menus/src/Field/MenuParentField.php | 2 +- .../com_menus/src/Field/MenuPresetField.php | 2 +- .../com_menus/src/Field/MenutypeField.php | 8 +- .../com_menus/src/Field/Modal/MenuField.php | 16 +- .../src/Helper/AssociationsHelper.php | 14 +- .../com_menus/src/Helper/MenusHelper.php | 42 +- .../com_menus/src/Model/ItemModel.php | 50 +- .../com_menus/src/Model/ItemsModel.php | 8 +- .../com_menus/src/Model/MenuModel.php | 20 +- .../com_menus/src/Model/MenusModel.php | 8 +- .../com_menus/src/Model/MenutypesModel.php | 46 +- .../com_menus/src/Service/HTML/Menus.php | 2 +- .../com_menus/src/View/Items/HtmlView.php | 8 +- .../com_menus/src/View/Menutypes/HtmlView.php | 8 +- .../components/com_menus/tmpl/item/edit.php | 10 +- .../com_menus/tmpl/item/edit_modules.php | 6 +- .../com_menus/tmpl/items/default.php | 12 +- .../tmpl/items/default_batch_body.php | 4 +- .../components/com_menus/tmpl/items/modal.php | 10 +- .../com_menus/tmpl/menus/default.php | 10 +- .../com_menus/tmpl/menutypes/default.php | 4 +- .../src/Controller/ConfigController.php | 2 +- .../src/Controller/MessagesController.php | 2 +- .../src/Field/UserMessagesField.php | 2 +- .../src/Helper/MessagesHelper.php | 2 +- .../com_messages/src/Model/ConfigModel.php | 4 +- .../com_messages/src/Model/MessageModel.php | 8 +- .../com_messages/src/Model/MessagesModel.php | 6 +- .../src/Service/HTML/Messages.php | 10 +- .../com_messages/tmpl/messages/default.php | 2 +- .../joomla/form/field/modulespositionedit.php | 12 +- .../src/Controller/ModuleController.php | 12 +- .../src/Controller/ModulesController.php | 4 +- .../com_modules/src/Helper/ModulesHelper.php | 16 +- .../com_modules/src/Model/ModuleModel.php | 44 +- .../com_modules/src/Model/ModulesModel.php | 10 +- .../com_modules/src/Model/PositionsModel.php | 14 +- .../com_modules/src/Service/HTML/Modules.php | 36 +- .../com_modules/src/View/Select/HtmlView.php | 2 +- .../com_modules/tmpl/module/edit.php | 8 +- .../tmpl/module/edit_assignment.php | 4 +- .../com_modules/tmpl/modules/default.php | 6 +- .../tmpl/modules/default_batch_body.php | 8 +- .../com_modules/tmpl/modules/modal.php | 6 +- .../src/Controller/AjaxController.php | 2 +- .../src/Controller/DisplayController.php | 2 +- .../src/Controller/NewsfeedController.php | 6 +- .../src/Controller/NewsfeedsController.php | 2 +- .../src/Field/Modal/NewsfeedField.php | 16 +- .../src/Field/NewsfeedsField.php | 2 +- .../src/Helper/AssociationsHelper.php | 18 +- .../com_newsfeeds/src/Model/NewsfeedModel.php | 8 +- .../src/Model/NewsfeedsModel.php | 6 +- .../src/Service/HTML/AdministratorService.php | 2 +- .../com_newsfeeds/src/Table/NewsfeedTable.php | 8 +- .../com_newsfeeds/tmpl/newsfeed/edit.php | 2 +- .../com_newsfeeds/tmpl/newsfeeds/default.php | 6 +- .../com_newsfeeds/tmpl/newsfeeds/modal.php | 6 +- .../src/Controller/PluginsController.php | 2 +- .../src/Field/PluginorderingField.php | 4 +- .../com_plugins/src/Helper/PluginsHelper.php | 2 +- .../com_plugins/src/Model/PluginModel.php | 20 +- .../com_plugins/src/Model/PluginsModel.php | 6 +- .../com_plugins/tmpl/plugin/edit.php | 8 +- .../com_plugins/tmpl/plugins/default.php | 2 +- .../src/Model/MessagesModel.php | 24 +- .../com_postinstall/tmpl/messages/default.php | 2 +- .../tmpl/messages/emptystate.php | 2 +- .../com_privacy/src/Plugin/PrivacyPlugin.php | 2 +- .../com_privacy/tmpl/consents/default.php | 8 +- .../com_privacy/tmpl/requests/default.php | 2 +- .../src/Controller/LinksController.php | 10 +- .../com_redirect/src/Field/RedirectField.php | 6 +- .../src/Helper/RedirectHelper.php | 2 +- .../com_redirect/src/Model/LinkModel.php | 10 +- .../com_redirect/src/Model/LinksModel.php | 6 +- .../src/Service/HTML/Redirect.php | 12 +- .../com_redirect/tmpl/links/default.php | 10 +- .../com_redirect/tmpl/links/emptystate.php | 4 +- .../src/Controller/DisplayController.php | 2 +- .../src/Controller/TaskController.php | 2 +- .../src/Controller/TasksController.php | 2 +- .../src/Event/ExecuteTaskEvent.php | 2 +- .../com_scheduler/src/Model/SelectModel.php | 2 +- .../com_scheduler/src/Model/TaskModel.php | 8 +- .../com_scheduler/src/Table/TaskTable.php | 4 +- .../com_scheduler/src/View/Task/HtmlView.php | 2 +- .../com_scheduler/tmpl/task/edit.php | 2 +- .../com_scheduler/tmpl/tasks/default.php | 2 +- .../com_tags/src/Controller/TagController.php | 4 +- .../src/Controller/TagsController.php | 2 +- .../com_tags/src/Model/TagModel.php | 18 +- .../com_tags/src/Model/TagsModel.php | 6 +- .../com_tags/src/Table/TagTable.php | 4 +- .../components/com_tags/tmpl/tags/default.php | 8 +- .../src/Controller/StyleController.php | 2 +- .../src/Controller/StylesController.php | 10 +- .../src/Controller/TemplateController.php | 12 +- .../src/Helper/TemplateHelper.php | 8 +- .../src/Helper/TemplatesHelper.php | 6 +- .../com_templates/src/Model/StyleModel.php | 36 +- .../com_templates/src/Model/StylesModel.php | 6 +- .../com_templates/src/Model/TemplateModel.php | 22 +- .../src/Model/TemplatesModel.php | 8 +- .../src/Service/HTML/Templates.php | 4 +- .../com_templates/tmpl/style/edit.php | 8 +- .../tmpl/style/edit_assignment.php | 2 +- .../com_templates/tmpl/styles/default.php | 6 +- .../com_templates/tmpl/template/default.php | 48 +- .../com_templates/tmpl/templates/default.php | 2 +- .../src/Controller/DisplayController.php | 2 +- .../src/Controller/GroupController.php | 2 +- .../src/Controller/GroupsController.php | 2 +- .../src/Controller/LevelController.php | 4 +- .../src/Controller/LevelsController.php | 2 +- .../src/Controller/NotesController.php | 2 +- .../src/Controller/UserController.php | 6 +- .../src/Controller/UsersController.php | 10 +- .../com_users/src/Helper/DebugHelper.php | 10 +- .../com_users/src/Helper/UsersHelper.php | 8 +- .../com_users/src/Model/DebuggroupModel.php | 8 +- .../com_users/src/Model/DebuguserModel.php | 8 +- .../com_users/src/Model/GroupModel.php | 24 +- .../com_users/src/Model/GroupsModel.php | 8 +- .../com_users/src/Model/LevelModel.php | 2 +- .../com_users/src/Model/LevelsModel.php | 8 +- .../com_users/src/Model/MailModel.php | 14 +- .../com_users/src/Model/NoteModel.php | 8 +- .../com_users/src/Model/NotesModel.php | 6 +- .../com_users/src/Model/UserModel.php | 46 +- .../com_users/src/Model/UsersModel.php | 20 +- .../com_users/src/Service/HTML/Users.php | 40 +- .../com_users/tmpl/debuggroup/default.php | 4 +- .../com_users/tmpl/debuguser/default.php | 4 +- .../components/com_users/tmpl/group/edit.php | 2 +- .../com_users/tmpl/groups/default.php | 4 +- .../com_users/tmpl/levels/default.php | 2 +- .../com_users/tmpl/notes/default.php | 2 +- .../components/com_users/tmpl/user/edit.php | 4 +- .../com_users/tmpl/users/default.php | 6 +- .../tmpl/users/default_batch_body.php | 8 +- .../components/com_users/tmpl/users/modal.php | 6 +- .../src/Controller/DisplayController.php | 4 +- .../src/Controller/StageController.php | 6 +- .../src/Controller/StagesController.php | 8 +- .../src/Controller/TransitionController.php | 6 +- .../src/Controller/TransitionsController.php | 4 +- .../src/Controller/WorkflowController.php | 8 +- .../src/Controller/WorkflowsController.php | 8 +- .../com_workflow/src/Model/StageModel.php | 14 +- .../com_workflow/src/Model/StagesModel.php | 8 +- .../src/Model/TransitionModel.php | 12 +- .../src/Model/TransitionsModel.php | 10 +- .../com_workflow/src/Model/WorkflowModel.php | 12 +- .../com_workflow/src/Model/WorkflowsModel.php | 10 +- .../com_workflow/src/Table/StageTable.php | 6 +- .../src/Table/TransitionTable.php | 4 +- .../com_workflow/src/Table/WorkflowTable.php | 2 +- .../com_workflow/tmpl/stages/default.php | 2 +- .../com_workflow/tmpl/transitions/default.php | 2 +- .../com_workflow/tmpl/workflows/default.php | 2 +- administrator/language/en-GB/localise.php | 8 +- .../mod_login/src/Helper/LoginHelper.php | 2 +- .../modules/mod_menu/src/Menu/CssMenu.php | 18 +- .../mod_multilangstatus/tmpl/default.php | 4 +- .../mod_privacy_dashboard/tmpl/default.php | 2 +- .../src/Helper/QuickIconHelper.php | 32 +- .../src/Helper/StatsAdminHelper.php | 4 +- .../modules/mod_submenu/src/Menu/Menu.php | 8 +- .../src/Controller/ContactController.php | 4 +- .../src/Controller/MediaController.php | 4 +- api/includes/framework.php | 4 +- api/index.php | 2 +- build/build.php | 48 +- build/bump.php | 22 +- build/deleted_file_check.php | 2 +- build/stubGenerator.php | 2 +- components/com_ajax/ajax.php | 4 +- .../src/Controller/DisplayController.php | 2 +- .../com_banners/src/Model/BannerModel.php | 2 +- .../com_banners/src/Model/BannersModel.php | 4 +- .../com_banners/src/Service/Category.php | 2 +- components/com_banners/src/Service/Router.php | 4 +- .../src/Controller/ConfigController.php | 4 +- .../src/Controller/ModulesController.php | 4 +- .../src/Controller/TemplatesController.php | 2 +- .../com_config/src/Model/ConfigModel.php | 4 +- components/com_config/src/Model/FormModel.php | 12 +- .../com_config/src/Model/ModulesModel.php | 18 +- .../com_config/src/Model/TemplatesModel.php | 6 +- .../com_contact/layouts/fields/render.php | 2 +- .../src/Controller/ContactController.php | 18 +- .../src/Controller/DisplayController.php | 8 +- .../src/Helper/AssociationHelper.php | 4 +- .../com_contact/src/Model/CategoriesModel.php | 2 +- .../com_contact/src/Model/CategoryModel.php | 12 +- .../com_contact/src/Model/ContactModel.php | 14 +- .../com_contact/src/Model/FeaturedModel.php | 8 +- .../com_contact/src/Model/FormModel.php | 4 +- .../com_contact/src/Service/Category.php | 2 +- components/com_contact/src/Service/Router.php | 6 +- .../com_contact/src/View/Contact/HtmlView.php | 16 +- .../tmpl/category/default_items.php | 2 +- .../contact/default_user_custom_fields.php | 2 +- components/com_contact/tmpl/form/edit.php | 2 +- components/com_content/helpers/icon.php | 8 +- .../src/Controller/ArticleController.php | 6 +- .../src/Controller/DisplayController.php | 6 +- .../src/Helper/AssociationHelper.php | 10 +- .../com_content/src/Helper/QueryHelper.php | 2 +- .../com_content/src/Model/ArchiveModel.php | 4 +- .../com_content/src/Model/ArticleModel.php | 2 +- .../com_content/src/Model/ArticlesModel.php | 14 +- .../com_content/src/Model/CategoriesModel.php | 2 +- .../com_content/src/Model/CategoryModel.php | 14 +- .../com_content/src/Model/FeaturedModel.php | 2 +- .../com_content/src/Model/FormModel.php | 2 +- .../com_content/src/Service/Category.php | 2 +- components/com_content/src/Service/Router.php | 6 +- .../com_content/src/View/Archive/HtmlView.php | 24 +- .../com_content/src/View/Article/HtmlView.php | 12 +- .../src/View/Category/HtmlView.php | 14 +- .../src/View/Featured/FeedView.php | 2 +- .../src/View/Featured/HtmlView.php | 18 +- .../tmpl/archive/default_items.php | 2 +- .../com_content/tmpl/article/default.php | 8 +- .../tmpl/article/default_links.php | 14 +- components/com_content/tmpl/category/blog.php | 8 +- .../com_content/tmpl/category/blog_item.php | 8 +- .../tmpl/category/default_articles.php | 6 +- .../tmpl/featured/default_item.php | 8 +- components/com_content/tmpl/form/edit.php | 2 +- .../src/Controller/DisplayController.php | 2 +- .../src/Dispatcher/Dispatcher.php | 2 +- .../com_fields/layouts/fields/render.php | 4 +- .../src/Controller/DisplayController.php | 2 +- .../src/Controller/DisplayController.php | 6 +- .../src/Controller/SuggestionsController.php | 6 +- .../com_finder/src/Helper/RouteHelper.php | 10 +- .../com_finder/src/Model/SearchModel.php | 12 +- .../com_finder/src/View/Search/HtmlView.php | 12 +- .../src/View/Search/OpensearchView.php | 2 +- .../com_finder/tmpl/search/default_form.php | 2 +- .../tmpl/search/default_results.php | 4 +- .../com_media/src/Dispatcher/Dispatcher.php | 2 +- .../layouts/joomla/searchtools/default.php | 6 +- .../com_menus/src/Dispatcher/Dispatcher.php | 2 +- .../src/Controller/DisplayController.php | 2 +- .../com_modules/src/Dispatcher/Dispatcher.php | 2 +- .../src/Controller/DisplayController.php | 4 +- .../src/Helper/AssociationHelper.php | 4 +- .../src/Model/CategoriesModel.php | 2 +- .../com_newsfeeds/src/Model/CategoryModel.php | 10 +- .../com_newsfeeds/src/Model/NewsfeedModel.php | 2 +- .../com_newsfeeds/src/Service/Category.php | 2 +- .../com_newsfeeds/src/Service/Router.php | 6 +- .../src/View/Category/HtmlView.php | 4 +- .../src/View/Newsfeed/HtmlView.php | 4 +- .../src/Controller/DisplayController.php | 4 +- .../src/Controller/TagsController.php | 4 +- .../com_tags/src/Helper/RouteHelper.php | 6 +- components/com_tags/src/Model/TagModel.php | 12 +- components/com_tags/src/Service/Router.php | 4 +- components/com_tags/src/View/Tag/FeedView.php | 2 +- components/com_tags/src/View/Tag/HtmlView.php | 10 +- .../com_tags/src/View/Tags/HtmlView.php | 4 +- .../src/Controller/DisplayController.php | 2 +- .../src/Controller/ProfileController.php | 4 +- .../src/Controller/RegistrationController.php | 2 +- .../src/Controller/RemindController.php | 2 +- .../src/Controller/ResetController.php | 6 +- .../src/Controller/UserController.php | 14 +- components/com_users/src/Model/LoginModel.php | 6 +- .../com_users/src/Model/ProfileModel.php | 14 +- .../com_users/src/Model/RegistrationModel.php | 24 +- .../com_users/src/Model/RemindModel.php | 6 +- components/com_users/src/Model/ResetModel.php | 12 +- .../com_users/src/View/Profile/HtmlView.php | 2 +- .../com_users/src/View/Reset/HtmlView.php | 2 +- .../com_users/tmpl/profile/default_custom.php | 4 +- .../src/Controller/DisplayController.php | 4 +- components/com_wrapper/src/Service/Router.php | 4 +- .../com_wrapper/src/View/Wrapper/HtmlView.php | 6 +- .../Application/InstallationApplication.php | 18 +- .../src/Controller/DisplayController.php | 2 +- .../Form/Field/Installation/LanguageField.php | 4 +- .../Form/Field/Installation/PrefixField.php | 2 +- .../src/Model/BaseInstallationModel.php | 2 +- installation/src/Model/ChecksModel.php | 8 +- installation/src/Model/ConfigurationModel.php | 24 +- installation/src/Model/DatabaseModel.php | 14 +- installation/src/Model/LanguagesModel.php | 20 +- installation/src/Model/SetupModel.php | 12 +- language/en-GB/localise.php | 6 +- layouts/joomla/content/category_default.php | 8 +- .../content/info_block/associations.php | 2 +- layouts/joomla/content/info_block/author.php | 2 +- layouts/joomla/content/language.php | 2 +- layouts/joomla/edit/admin_modules.php | 14 +- layouts/joomla/edit/associations.php | 4 +- layouts/joomla/edit/fieldset.php | 8 +- layouts/joomla/edit/global.php | 14 +- layouts/joomla/edit/params.php | 16 +- layouts/joomla/edit/publishingdata.php | 14 +- layouts/joomla/editors/buttons/modal.php | 6 +- layouts/joomla/form/field/calendar.php | 2 +- layouts/joomla/form/field/checkboxes.php | 2 +- layouts/joomla/form/field/color/advanced.php | 4 +- layouts/joomla/form/field/contenthistory.php | 4 +- .../form/field/groupedlist-fancy-select.php | 10 +- layouts/joomla/form/field/groupedlist.php | 10 +- .../joomla/form/field/list-fancy-select.php | 2 +- layouts/joomla/form/field/list.php | 4 +- layouts/joomla/form/field/media.php | 4 +- layouts/joomla/form/field/meter.php | 4 +- layouts/joomla/form/field/number.php | 4 +- layouts/joomla/form/field/password.php | 4 +- layouts/joomla/form/field/radio/buttons.php | 2 +- layouts/joomla/form/field/radiobasic.php | 2 +- layouts/joomla/form/field/range.php | 4 +- layouts/joomla/form/field/rules.php | 4 +- .../form/field/subform/repeatable-table.php | 4 +- .../subform/repeatable-table/section.php | 2 +- .../joomla/form/field/subform/repeatable.php | 4 +- layouts/joomla/form/field/tag.php | 2 +- layouts/joomla/form/field/tel.php | 4 +- layouts/joomla/form/field/text.php | 4 +- layouts/joomla/form/field/textarea.php | 4 +- layouts/joomla/form/field/url.php | 4 +- layouts/joomla/form/field/user.php | 8 +- layouts/joomla/html/batch/access.php | 4 +- layouts/joomla/html/batch/item.php | 4 +- layouts/joomla/html/batch/tag.php | 2 +- layouts/joomla/html/batch/workflowstage.php | 6 +- layouts/joomla/searchtools/default.php | 6 +- layouts/joomla/searchtools/default/bar.php | 2 +- layouts/joomla/toolbar/versions.php | 4 +- .../libraries/html/bootstrap/modal/iframe.php | 4 +- .../libraries/html/bootstrap/modal/main.php | 6 +- .../editors/tinymce/field/tinymcebuilder.php | 10 +- libraries/cms.php | 6 +- libraries/loader.php | 34 +- libraries/namespacemap.php | 2 +- libraries/php-encryption/Crypto.php | 2 +- libraries/src/Access/Access.php | 82 +- libraries/src/Access/Rule.php | 4 +- libraries/src/Access/Rules.php | 4 +- libraries/src/Adapter/Adapter.php | 8 +- libraries/src/Adapter/AdapterInstance.php | 2 +- .../Application/AdministratorApplication.php | 10 +- libraries/src/Application/ApiApplication.php | 12 +- .../src/Application/ApplicationHelper.php | 2 +- libraries/src/Application/CMSApplication.php | 42 +- .../CMSWebApplicationInterface.php | 4 +- .../src/Application/ConsoleApplication.php | 2 +- .../src/Application/DaemonApplication.php | 12 +- libraries/src/Application/SiteApplication.php | 16 +- libraries/src/Application/WebApplication.php | 10 +- .../AssociationExtensionHelper.php | 22 +- .../src/Authentication/Authentication.php | 6 +- libraries/src/Button/ActionButton.php | 2 +- libraries/src/Button/PublishedButton.php | 2 +- libraries/src/Cache/Cache.php | 18 +- libraries/src/Cache/CacheController.php | 6 +- .../src/Cache/CacheControllerFactory.php | 2 +- .../Cache/CacheControllerFactoryInterface.php | 2 +- libraries/src/Cache/CacheStorage.php | 6 +- .../Cache/Controller/CallbackController.php | 16 +- .../src/Cache/Controller/PageController.php | 6 +- .../src/Cache/Controller/ViewController.php | 4 +- libraries/src/Cache/Storage/ApcuStorage.php | 2 +- libraries/src/Cache/Storage/FileStorage.php | 22 +- .../src/Cache/Storage/MemcachedStorage.php | 8 +- libraries/src/Cache/Storage/RedisStorage.php | 10 +- .../src/Cache/Storage/WincacheStorage.php | 2 +- libraries/src/Captcha/Captcha.php | 10 +- libraries/src/Categories/Categories.php | 6 +- libraries/src/Categories/CategoryNode.php | 4 +- .../src/Categories/CategoryServiceTrait.php | 4 +- libraries/src/Changelog/Changelog.php | 22 +- libraries/src/Client/ClientHelper.php | 14 +- libraries/src/Client/FtpClient.php | 56 +- libraries/src/Component/ComponentHelper.php | 24 +- libraries/src/Component/ComponentRecord.php | 2 +- .../src/Component/Router/RouterLegacy.php | 4 +- libraries/src/Component/Router/RouterView.php | 18 +- .../Router/RouterViewConfiguration.php | 8 +- .../src/Component/Router/Rules/MenuRules.php | 16 +- .../Component/Router/Rules/NomenuRules.php | 10 +- .../Component/Router/Rules/StandardRules.php | 8 +- libraries/src/Console/FinderIndexCommand.php | 8 +- .../Console/RemoveUserFromGroupCommand.php | 2 +- libraries/src/Crypt/Cipher/CryptoCipher.php | 2 +- libraries/src/Crypt/Cipher/SodiumCipher.php | 2 +- .../src/Dispatcher/ComponentDispatcher.php | 2 +- libraries/src/Document/Document.php | 40 +- libraries/src/Document/ErrorDocument.php | 8 +- libraries/src/Document/FeedDocument.php | 6 +- libraries/src/Document/HtmlDocument.php | 54 +- libraries/src/Document/ImageDocument.php | 4 +- libraries/src/Document/JsonDocument.php | 4 +- libraries/src/Document/JsonapiDocument.php | 4 +- libraries/src/Document/OpensearchDocument.php | 10 +- libraries/src/Document/RawDocument.php | 4 +- .../Document/Renderer/Feed/AtomRenderer.php | 2 +- .../Document/Renderer/Feed/RssRenderer.php | 2 +- .../Renderer/Html/ComponentRenderer.php | 2 +- .../Document/Renderer/Html/HeadRenderer.php | 2 +- .../Renderer/Html/MessageRenderer.php | 8 +- .../Document/Renderer/Html/MetasRenderer.php | 2 +- .../Document/Renderer/Html/ModuleRenderer.php | 4 +- .../Renderer/Html/ModulesRenderer.php | 6 +- .../Renderer/Html/ScriptsRenderer.php | 10 +- .../Document/Renderer/Html/StylesRenderer.php | 6 +- libraries/src/Document/XmlDocument.php | 4 +- libraries/src/Editor/Editor.php | 12 +- libraries/src/Encrypt/AES/OpenSSL.php | 8 +- libraries/src/Encrypt/Base32.php | 4 +- libraries/src/Environment/Browser.php | 12 +- .../src/Event/Model/BeforeBatchEvent.php | 2 +- .../src/Event/Table/AfterDeleteEvent.php | 2 +- libraries/src/Event/Table/AfterLoadEvent.php | 2 +- libraries/src/Event/Table/AfterMoveEvent.php | 2 +- .../src/Event/Table/AfterReorderEvent.php | 2 +- libraries/src/Event/Table/AfterStoreEvent.php | 2 +- libraries/src/Event/Table/BeforeBindEvent.php | 2 +- .../src/Event/Table/BeforeCheckinEvent.php | 2 +- .../src/Event/Table/BeforeCheckoutEvent.php | 2 +- .../src/Event/Table/BeforeDeleteEvent.php | 2 +- libraries/src/Event/Table/BeforeLoadEvent.php | 2 +- libraries/src/Event/Table/BeforeMoveEvent.php | 2 +- .../src/Event/Table/BeforePublishEvent.php | 2 +- .../src/Event/Table/BeforeReorderEvent.php | 2 +- .../src/Event/Table/BeforeStoreEvent.php | 2 +- libraries/src/Event/Table/SetNewTagsEvent.php | 2 +- libraries/src/Event/View/DisplayEvent.php | 2 +- .../src/Event/WebAsset/AbstractEvent.php | 2 +- .../WebAsset/WebAssetRegistryAssetChanged.php | 2 +- .../src/Event/Workflow/AbstractEvent.php | 2 +- .../WorkflowFunctionalityUsedEvent.php | 2 +- .../Workflow/WorkflowTransitionEvent.php | 2 +- libraries/src/Extension/ExtensionHelper.php | 462 ++-- libraries/src/Extension/LegacyComponent.php | 8 +- libraries/src/Factory.php | 14 +- libraries/src/Feed/Feed.php | 12 +- libraries/src/Feed/FeedEntry.php | 12 +- libraries/src/Feed/FeedFactory.php | 2 +- libraries/src/Feed/FeedParser.php | 6 +- libraries/src/Feed/Parser/AtomParser.php | 2 +- libraries/src/Feed/Parser/RssParser.php | 4 +- libraries/src/Filesystem/File.php | 20 +- libraries/src/Filesystem/FilesystemHelper.php | 6 +- libraries/src/Filesystem/Folder.php | 30 +- libraries/src/Filesystem/Patcher.php | 30 +- libraries/src/Filesystem/Stream.php | 8 +- .../src/Filesystem/Streams/StreamString.php | 4 +- .../Filesystem/Support/StringController.php | 2 +- libraries/src/Filter/InputFilter.php | 48 +- libraries/src/Filter/OutputFilter.php | 2 +- .../src/Form/Field/CachehandlerField.php | 2 +- libraries/src/Form/Field/CalendarField.php | 4 +- libraries/src/Form/Field/CaptchaField.php | 2 +- libraries/src/Form/Field/CategoryField.php | 6 +- libraries/src/Form/Field/CheckboxesField.php | 4 +- libraries/src/Form/Field/ChromestyleField.php | 6 +- libraries/src/Form/Field/ColorField.php | 22 +- libraries/src/Form/Field/ComboField.php | 4 +- .../src/Form/Field/ComponentlayoutField.php | 18 +- .../src/Form/Field/ContenthistoryField.php | 4 +- libraries/src/Form/Field/ContenttypeField.php | 2 +- libraries/src/Form/Field/EditorField.php | 12 +- libraries/src/Form/Field/EmailField.php | 4 +- libraries/src/Form/Field/FileField.php | 4 +- libraries/src/Form/Field/FilelistField.php | 2 +- libraries/src/Form/Field/FolderlistField.php | 2 +- .../src/Form/Field/FrontendlanguageField.php | 2 +- libraries/src/Form/Field/GroupedlistField.php | 6 +- libraries/src/Form/Field/HeadertagField.php | 4 +- libraries/src/Form/Field/IntegerField.php | 2 +- .../Form/Field/LastvisitdaterangeField.php | 4 +- libraries/src/Form/Field/LimitboxField.php | 10 +- libraries/src/Form/Field/ListField.php | 8 +- libraries/src/Form/Field/MediaField.php | 4 +- libraries/src/Form/Field/MenuField.php | 8 +- libraries/src/Form/Field/MenuitemField.php | 14 +- libraries/src/Form/Field/MeterField.php | 4 +- .../src/Form/Field/ModulelayoutField.php | 18 +- libraries/src/Form/Field/ModuleorderField.php | 4 +- .../src/Form/Field/ModulepositionField.php | 8 +- libraries/src/Form/Field/ModuletagField.php | 4 +- libraries/src/Form/Field/NumberField.php | 4 +- libraries/src/Form/Field/OrderingField.php | 2 +- libraries/src/Form/Field/PasswordField.php | 4 +- .../src/Form/Field/PluginstatusField.php | 4 +- .../src/Form/Field/PredefinedlistField.php | 10 +- libraries/src/Form/Field/RadioField.php | 4 +- libraries/src/Form/Field/RadiobasicField.php | 4 +- libraries/src/Form/Field/RangeField.php | 4 +- .../src/Form/Field/RedirectStatusField.php | 4 +- .../Form/Field/RegistrationdaterangeField.php | 4 +- libraries/src/Form/Field/RulesField.php | 8 +- .../src/Form/Field/SessionhandlerField.php | 2 +- libraries/src/Form/Field/SpacerField.php | 4 +- libraries/src/Form/Field/SqlField.php | 8 +- libraries/src/Form/Field/StatusField.php | 4 +- libraries/src/Form/Field/SubformField.php | 20 +- libraries/src/Form/Field/TagField.php | 14 +- libraries/src/Form/Field/TelephoneField.php | 4 +- .../src/Form/Field/TemplatestyleField.php | 4 +- libraries/src/Form/Field/TextField.php | 6 +- libraries/src/Form/Field/TextareaField.php | 4 +- libraries/src/Form/Field/TimezoneField.php | 6 +- libraries/src/Form/Field/UrlField.php | 4 +- libraries/src/Form/Field/UserField.php | 4 +- libraries/src/Form/Field/UseractiveField.php | 4 +- .../src/Form/Field/UsergrouplistField.php | 8 +- libraries/src/Form/Field/UserstateField.php | 4 +- .../src/Form/Field/WorkflowconditionField.php | 8 +- .../src/Form/Field/WorkflowstageField.php | 4 +- libraries/src/Form/Filter/IntarrayFilter.php | 2 +- libraries/src/Form/Filter/RulesFilter.php | 4 +- libraries/src/Form/Filter/UrlFilter.php | 2 +- libraries/src/Form/Form.php | 8 +- libraries/src/Form/FormFactory.php | 2 +- libraries/src/Form/FormFactoryInterface.php | 2 +- libraries/src/Form/FormField.php | 20 +- libraries/src/Form/FormHelper.php | 12 +- libraries/src/Form/Rule/CaptchaRule.php | 2 +- libraries/src/Form/Rule/OptionsRule.php | 2 +- libraries/src/Form/Rule/RulesRule.php | 4 +- libraries/src/Form/Rule/TelRule.php | 4 +- libraries/src/Form/Rule/UrlRule.php | 6 +- libraries/src/HTML/HTMLHelper.php | 24 +- libraries/src/HTML/Helpers/Access.php | 18 +- .../src/HTML/Helpers/ActionsDropdown.php | 4 +- libraries/src/HTML/Helpers/AdminLanguage.php | 4 +- libraries/src/HTML/Helpers/Behavior.php | 30 +- libraries/src/HTML/Helpers/Category.php | 10 +- libraries/src/HTML/Helpers/Content.php | 4 +- .../src/HTML/Helpers/ContentLanguage.php | 2 +- libraries/src/HTML/Helpers/DraggableList.php | 2 +- libraries/src/HTML/Helpers/Dropdown.php | 2 +- libraries/src/HTML/Helpers/Form.php | 6 +- libraries/src/HTML/Helpers/FormBehavior.php | 8 +- libraries/src/HTML/Helpers/Grid.php | 8 +- libraries/src/HTML/Helpers/Icons.php | 2 +- libraries/src/HTML/Helpers/JGrid.php | 28 +- libraries/src/HTML/Helpers/Jquery.php | 2 +- libraries/src/HTML/Helpers/Links.php | 4 +- libraries/src/HTML/Helpers/ListHelper.php | 18 +- libraries/src/HTML/Helpers/Menu.php | 30 +- libraries/src/HTML/Helpers/Number.php | 4 +- libraries/src/HTML/Helpers/SearchTools.php | 8 +- libraries/src/HTML/Helpers/Select.php | 32 +- libraries/src/HTML/Helpers/Sidebar.php | 8 +- libraries/src/HTML/Helpers/StringHelper.php | 4 +- libraries/src/HTML/Helpers/Tag.php | 22 +- libraries/src/HTML/Helpers/UiTab.php | 6 +- libraries/src/HTML/Helpers/User.php | 2 +- libraries/src/HTML/Helpers/WorkflowStage.php | 8 +- libraries/src/Help/Help.php | 12 +- libraries/src/Helper/CMSHelper.php | 2 +- libraries/src/Helper/ContentHelper.php | 6 +- libraries/src/Helper/LibraryHelper.php | 4 +- libraries/src/Helper/MediaHelper.php | 12 +- libraries/src/Helper/ModuleHelper.php | 46 +- libraries/src/Helper/RouteHelper.php | 24 +- libraries/src/Helper/TagsHelper.php | 34 +- libraries/src/Helper/UserGroupsHelper.php | 14 +- libraries/src/Http/HttpFactory.php | 2 +- .../src/Http/Transport/CurlTransport.php | 8 +- .../src/Http/Transport/SocketTransport.php | 6 +- .../src/Http/Transport/StreamTransport.php | 16 +- libraries/src/Input/Cli.php | 8 +- libraries/src/Input/Cookie.php | 2 +- libraries/src/Input/Files.php | 14 +- libraries/src/Input/Input.php | 12 +- libraries/src/Input/Json.php | 4 +- .../Installer/Adapter/ComponentAdapter.php | 34 +- .../src/Installer/Adapter/FileAdapter.php | 18 +- .../src/Installer/Adapter/LanguageAdapter.php | 14 +- .../src/Installer/Adapter/LibraryAdapter.php | 20 +- .../src/Installer/Adapter/ModuleAdapter.php | 16 +- .../src/Installer/Adapter/PackageAdapter.php | 26 +- .../src/Installer/Adapter/PluginAdapter.php | 12 +- .../src/Installer/Adapter/TemplateAdapter.php | 14 +- libraries/src/Installer/Installer.php | 70 +- libraries/src/Installer/InstallerAdapter.php | 14 +- libraries/src/Installer/InstallerHelper.php | 16 +- libraries/src/Installer/InstallerScript.php | 14 +- libraries/src/Installer/Manifest.php | 2 +- libraries/src/Language/Associations.php | 8 +- .../src/Language/CachingLanguageFactory.php | 2 +- libraries/src/Language/Language.php | 52 +- libraries/src/Language/LanguageHelper.php | 40 +- libraries/src/Language/Text.php | 2 +- libraries/src/Language/Transliterate.php | 8 +- libraries/src/Layout/BaseLayout.php | 8 +- libraries/src/Layout/FileLayout.php | 22 +- libraries/src/Log/DelegatingPsrLogger.php | 6 +- libraries/src/Log/Log.php | 18 +- libraries/src/Log/LogEntry.php | 8 +- libraries/src/Log/Logger.php | 6 +- libraries/src/Log/Logger/DatabaseLogger.php | 4 +- .../src/Log/Logger/FormattedtextLogger.php | 12 +- libraries/src/Log/Logger/SyslogLogger.php | 4 +- .../src/MVC/Controller/AdminController.php | 28 +- .../src/MVC/Controller/ApiController.php | 10 +- .../src/MVC/Controller/BaseController.php | 46 +- .../src/MVC/Controller/FormController.php | 30 +- libraries/src/MVC/Factory/ApiMVCFactory.php | 4 +- libraries/src/MVC/Factory/LegacyFactory.php | 2 +- libraries/src/MVC/Model/AdminModel.php | 50 +- libraries/src/MVC/Model/BaseDatabaseModel.php | 6 +- libraries/src/MVC/Model/BaseModel.php | 8 +- libraries/src/MVC/Model/FormBehaviorTrait.php | 10 +- libraries/src/MVC/Model/FormModel.php | 10 +- .../src/MVC/Model/FormModelInterface.php | 2 +- .../src/MVC/Model/LegacyModelLoaderTrait.php | 8 +- libraries/src/MVC/Model/ListModel.php | 40 +- .../src/MVC/Model/WorkflowModelInterface.php | 2 +- libraries/src/MVC/View/AbstractView.php | 4 +- libraries/src/MVC/View/CategoriesView.php | 2 +- libraries/src/MVC/View/CategoryView.php | 6 +- .../src/MVC/View/Event/OnGetApiFields.php | 2 +- libraries/src/MVC/View/HtmlView.php | 14 +- libraries/src/MVC/View/JsonApiView.php | 2 +- libraries/src/MVC/View/JsonView.php | 4 +- libraries/src/MVC/View/ListView.php | 4 +- libraries/src/Mail/Mail.php | 4 +- libraries/src/Mail/MailHelper.php | 2 +- libraries/src/Mail/MailTemplate.php | 14 +- libraries/src/Menu/AbstractMenu.php | 12 +- libraries/src/Menu/AdministratorMenu.php | 2 +- libraries/src/Menu/MenuItem.php | 6 +- libraries/src/Menu/SiteMenu.php | 8 +- libraries/src/Microdata/Microdata.php | 6 +- libraries/src/Object/CMSObject.php | 2 +- libraries/src/Pagination/Pagination.php | 28 +- libraries/src/Pathway/Pathway.php | 6 +- libraries/src/Pathway/SitePathway.php | 2 +- libraries/src/Plugin/CMSPlugin.php | 2 +- libraries/src/Profiler/Profiler.php | 10 +- libraries/src/Response/JsonResponse.php | 2 +- libraries/src/Router/AdministratorRouter.php | 2 +- libraries/src/Router/Route.php | 8 +- libraries/src/Router/Router.php | 32 +- libraries/src/Router/SiteRouter.php | 26 +- libraries/src/Schema/ChangeItem.php | 2 +- .../src/Schema/ChangeItem/MysqlChangeItem.php | 22 +- .../ChangeItem/PostgresqlChangeItem.php | 40 +- .../Schema/ChangeItem/SqlsrvChangeItem.php | 12 +- libraries/src/Schema/ChangeSet.php | 14 +- .../Serializer/Events/OnGetApiAttributes.php | 2 +- .../Serializer/Events/OnGetApiRelation.php | 2 +- libraries/src/Table/Asset.php | 2 +- libraries/src/Table/Category.php | 4 +- libraries/src/Table/Content.php | 4 +- libraries/src/Table/ContentHistory.php | 14 +- libraries/src/Table/ContentType.php | 4 +- libraries/src/Table/CoreContent.php | 6 +- libraries/src/Table/Extension.php | 2 +- libraries/src/Table/Language.php | 8 +- libraries/src/Table/Menu.php | 22 +- libraries/src/Table/MenuType.php | 4 +- libraries/src/Table/Nested.php | 6 +- libraries/src/Table/Table.php | 60 +- libraries/src/Table/TableInterface.php | 2 +- libraries/src/Table/Update.php | 4 +- libraries/src/Table/Usergroup.php | 6 +- libraries/src/Tag/TagServiceTrait.php | 4 +- libraries/src/Toolbar/Button/PopupButton.php | 2 +- libraries/src/Toolbar/CoreButtonsTrait.php | 2 +- libraries/src/Toolbar/Toolbar.php | 2 +- libraries/src/Toolbar/ToolbarButton.php | 2 +- libraries/src/Toolbar/ToolbarHelper.php | 10 +- libraries/src/Tree/ImmutableNodeTrait.php | 4 +- libraries/src/UCM/UCMBase.php | 4 +- libraries/src/UCM/UCMContent.php | 4 +- .../src/Updater/Adapter/CollectionAdapter.php | 14 +- .../src/Updater/Adapter/ExtensionAdapter.php | 10 +- libraries/src/Updater/Update.php | 10 +- libraries/src/Updater/UpdateAdapter.php | 8 +- libraries/src/Updater/Updater.php | 16 +- libraries/src/Uri/Uri.php | 32 +- libraries/src/User/User.php | 20 +- libraries/src/User/UserHelper.php | 8 +- libraries/src/Utility/BufferStreamHandler.php | 2 +- libraries/src/Utility/Utility.php | 4 +- .../Versioning/VersionableControllerTrait.php | 2 +- libraries/src/Versioning/Versioning.php | 2 +- .../WebAsset/AssetItem/KeepaliveAssetItem.php | 2 +- .../src/Helper/ArticlesArchiveHelper.php | 2 +- .../tmpl/default_items.php | 2 +- .../mod_articles_category.php | 2 +- .../src/Helper/ArticlesCategoryHelper.php | 34 +- .../src/Helper/ArticlesLatestHelper.php | 8 +- .../src/Helper/ArticlesNewsHelper.php | 12 +- modules/mod_articles_news/tmpl/_item.php | 2 +- .../mod_banners/src/Helper/BannersHelper.php | 2 +- modules/mod_banners/tmpl/default.php | 2 +- .../src/Helper/BreadcrumbsHelper.php | 2 +- modules/mod_finder/mod_finder.php | 6 +- .../mod_finder/src/Helper/FinderHelper.php | 4 +- modules/mod_finder/tmpl/default.php | 2 +- .../src/Helper/LanguagesHelper.php | 6 +- modules/mod_languages/tmpl/default.php | 4 +- modules/mod_menu/src/Helper/MenuHelper.php | 2 +- modules/mod_menu/tmpl/default_component.php | 2 +- modules/mod_menu/tmpl/default_url.php | 2 +- .../src/Helper/RandomImageHelper.php | 2 +- modules/mod_random_image/tmpl/default.php | 2 +- .../mod_related_items/mod_related_items.php | 2 +- .../src/Helper/RelatedItemsHelper.php | 2 +- modules/mod_stats/src/Helper/StatsHelper.php | 4 +- modules/mod_tags_popular/mod_tags_popular.php | 2 +- .../src/Helper/TagsPopularHelper.php | 2 +- modules/mod_tags_similar/mod_tags_similar.php | 2 +- .../src/Helper/TagsSimilarHelper.php | 4 +- .../src/Helper/UsersLatestHelper.php | 4 +- .../src/Helper/WhosonlineHelper.php | 4 +- .../actionlog/joomla/src/Extension/Joomla.php | 142 +- plugins/authentication/cookie/cookie.php | 8 +- .../taggable/src/Extension/Taggable.php | 4 +- .../versionable/src/Extension/Versionable.php | 2 +- plugins/captcha/recaptcha/recaptcha.php | 8 +- .../recaptcha_invisible.php | 8 +- .../src/Field/ConsentBoxField.php | 10 +- plugins/content/contact/contact.php | 4 +- plugins/content/fields/fields.php | 12 +- plugins/content/finder/finder.php | 10 +- plugins/content/joomla/joomla.php | 22 +- plugins/content/loadmodule/loadmodule.php | 10 +- plugins/content/pagebreak/pagebreak.php | 10 +- plugins/content/vote/tmpl/vote.php | 2 +- plugins/editors-xtd/pagebreak/pagebreak.php | 2 +- plugins/editors-xtd/readmore/readmore.php | 4 +- plugins/editors/codemirror/codemirror.php | 26 +- .../layouts/editors/codemirror/element.php | 4 +- .../codemirror/src/Field/FontsField.php | 2 +- plugins/editors/none/none.php | 2 +- .../tinymce/src/Field/TinymcebuilderField.php | 32 +- .../tinymce/src/Field/UploaddirsField.php | 2 +- .../tinymce/src/PluginTraits/DisplayTrait.php | 2 +- .../extension/namespacemap/namespacemap.php | 2 +- plugins/fields/checkboxes/tmpl/checkboxes.php | 2 +- plugins/fields/editor/editor.php | 2 +- plugins/fields/list/tmpl/list.php | 2 +- plugins/fields/media/media.php | 2 +- plugins/fields/radio/tmpl/radio.php | 2 +- plugins/fields/sql/tmpl/sql.php | 2 +- plugins/fields/subform/subform.php | 24 +- plugins/fields/subform/tmpl/subform.php | 4 +- plugins/fields/user/tmpl/user.php | 2 +- .../usergrouplist/tmpl/usergrouplist.php | 2 +- plugins/finder/contacts/contacts.php | 4 +- plugins/finder/content/content.php | 4 +- plugins/finder/newsfeeds/newsfeeds.php | 4 +- plugins/finder/tags/tags.php | 2 +- .../folderinstaller/folderinstaller.php | 2 +- plugins/installer/override/override.php | 2 +- .../packageinstaller/packageinstaller.php | 2 +- .../installer/urlinstaller/urlinstaller.php | 2 +- plugins/media-action/resize/resize.php | 2 +- plugins/privacy/actionlogs/actionlogs.php | 6 +- plugins/privacy/consents/consents.php | 4 +- plugins/privacy/contact/contact.php | 4 +- plugins/privacy/content/content.php | 4 +- plugins/privacy/message/message.php | 4 +- plugins/privacy/user/user.php | 6 +- .../extensionupdate/extensionupdate.php | 14 +- .../src/Extension/Joomlaupdate.php | 2 +- .../quickicon/overridecheck/overridecheck.php | 14 +- .../phpversioncheck/phpversioncheck.php | 32 +- .../quickicon/privacycheck/privacycheck.php | 18 +- plugins/sampledata/blog/blog.php | 508 ++-- plugins/sampledata/multilang/multilang.php | 90 +- plugins/sampledata/testing/testing.php | 2238 ++++++++--------- plugins/system/actionlogs/actionlogs.php | 4 +- .../DataCollector/RequestDataCollector.php | 4 +- plugins/system/fields/fields.php | 10 +- plugins/system/highlight/highlight.php | 2 +- plugins/system/languagecode/languagecode.php | 12 +- .../system/languagefilter/languagefilter.php | 34 +- plugins/system/log/log.php | 4 +- plugins/system/logrotation/logrotation.php | 12 +- .../system/privacyconsent/privacyconsent.php | 2 +- plugins/system/redirect/redirect.php | 24 +- plugins/system/sef/sef.php | 8 +- plugins/system/stats/layouts/stats.php | 2 +- .../stats/src/Field/AbstractStatsField.php | 4 +- plugins/system/stats/src/Field/DataField.php | 4 +- .../postinstall/updatecachetime.php | 2 +- .../sitestatus/src/Extension/SiteStatus.php | 2 +- .../user/contactcreator/contactcreator.php | 10 +- plugins/user/joomla/joomla.php | 2 +- plugins/user/terms/terms.php | 2 +- plugins/webservices/modules/modules.php | 4 +- .../Codeception/_support/Helper/JoomlaDb.php | 2 +- tests/Integration/DBTestHelper.php | 4 +- tests/Unit/Libraries/Cms/Access/RulesTest.php | 16 +- .../ExtensionDiscoverListCommandTest.php | 18 +- .../Form/Field/AccessiblemediaFieldTest.php | 20 +- .../Image/Filter/FilterBackgroundfillTest.php | 48 +- .../Cms/Image/Filter/FilterBrightnessTest.php | 4 +- .../Cms/Image/Filter/FilterContrastTest.php | 4 +- .../Cms/Image/Filter/FilterEdgedetectTest.php | 2 +- tests/Unit/Libraries/Cms/Image/ImageTest.php | 58 +- .../Cms/MVC/Controller/BaseControllerTest.php | 2 +- .../Libraries/Cms/MVC/Model/FormModelTest.php | 28 +- .../Libraries/Cms/Object/CMSObjectTest.php | 2 +- tests/Unit/Libraries/Cms/Uri/UriTest.php | 12 +- 1042 files changed, 6127 insertions(+), 6127 deletions(-) diff --git a/administrator/components/com_actionlogs/src/Controller/ActionlogsController.php b/administrator/components/com_actionlogs/src/Controller/ActionlogsController.php index 54eb95940286f..1d38d94cce466 100644 --- a/administrator/components/com_actionlogs/src/Controller/ActionlogsController.php +++ b/administrator/components/com_actionlogs/src/Controller/ActionlogsController.php @@ -73,7 +73,7 @@ public function exportLogs() $task = $this->getTask(); - $pks = array(); + $pks = []; if ($task == 'exportSelectedLogs') { // Get selected logs @@ -116,7 +116,7 @@ public function exportLogs() } fclose($output); - $this->app->triggerEvent('onAfterLogExport', array()); + $this->app->triggerEvent('onAfterLogExport', []); $this->app->close(); } else { $this->setMessage(Text::_('COM_ACTIONLOGS_NO_LOGS_TO_EXPORT')); diff --git a/administrator/components/com_actionlogs/src/Field/ExtensionField.php b/administrator/components/com_actionlogs/src/Field/ExtensionField.php index b25098fd07062..49ec4a0a6d123 100644 --- a/administrator/components/com_actionlogs/src/Field/ExtensionField.php +++ b/administrator/components/com_actionlogs/src/Field/ExtensionField.php @@ -52,7 +52,7 @@ public function getOptions() $db->setQuery($query); $context = $db->loadColumn(); - $options = array(); + $options = []; if (\count($context) > 0) { foreach ($context as $item) { diff --git a/administrator/components/com_actionlogs/src/Field/LogsdaterangeField.php b/administrator/components/com_actionlogs/src/Field/LogsdaterangeField.php index b01571e8615c3..f211355b965d1 100644 --- a/administrator/components/com_actionlogs/src/Field/LogsdaterangeField.php +++ b/administrator/components/com_actionlogs/src/Field/LogsdaterangeField.php @@ -39,14 +39,14 @@ class LogsdaterangeField extends PredefinedlistField * @var array * @since 3.9.0 */ - protected $predefinedOptions = array( + protected $predefinedOptions = [ 'today' => 'COM_ACTIONLOGS_OPTION_RANGE_TODAY', 'past_week' => 'COM_ACTIONLOGS_OPTION_RANGE_PAST_WEEK', 'past_1month' => 'COM_ACTIONLOGS_OPTION_RANGE_PAST_1MONTH', 'past_3month' => 'COM_ACTIONLOGS_OPTION_RANGE_PAST_3MONTH', 'past_6month' => 'COM_ACTIONLOGS_OPTION_RANGE_PAST_6MONTH', 'past_year' => 'COM_ACTIONLOGS_OPTION_RANGE_PAST_YEAR', - ); + ]; /** * Method to instantiate the form field object. diff --git a/administrator/components/com_actionlogs/src/Field/PlugininfoField.php b/administrator/components/com_actionlogs/src/Field/PlugininfoField.php index f5adfe9c80df7..b1c3ac45f3a81 100644 --- a/administrator/components/com_actionlogs/src/Field/PlugininfoField.php +++ b/administrator/components/com_actionlogs/src/Field/PlugininfoField.php @@ -57,7 +57,7 @@ protected function getInput() 'link', Route::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . $result), Text::_('PLG_SYSTEM_ACTIONLOGS_JOOMLA_ACTIONLOG_DISABLED'), - array('class' => 'alert-link') + ['class' => 'alert-link'] ); return '
' diff --git a/administrator/components/com_actionlogs/src/Helper/ActionlogsHelper.php b/administrator/components/com_actionlogs/src/Helper/ActionlogsHelper.php index fc608a6a827d7..af6254ef0bab5 100644 --- a/administrator/components/com_actionlogs/src/Helper/ActionlogsHelper.php +++ b/administrator/components/com_actionlogs/src/Helper/ActionlogsHelper.php @@ -37,7 +37,7 @@ class ActionlogsHelper * * @since 3.9.7 */ - private static $characters = array('=', '+', '-', '@'); + private static $characters = ['=', '+', '-', '@']; /** * Method to convert logs objects array to an iterable type for use with a CSV export @@ -72,14 +72,14 @@ public static function getCsvData($data): Generator static::loadTranslationFiles($extension); - yield array( + yield [ 'id' => $log->id, 'message' => self::escapeCsvFormula(strip_tags(static::getHumanReadableLogMessage($log, false))), 'extension' => self::escapeCsvFormula(Text::_($extension)), 'date' => (new Date($log->log_date, new \DateTimeZone('UTC')))->format('Y-m-d H:i:s T'), 'name' => self::escapeCsvFormula($log->name), 'ip_address' => self::escapeCsvFormula($log->ip_address === 'COM_ACTIONLOGS_DISABLED' ? $disabledText : $log->ip_address) - ); + ]; } } @@ -94,7 +94,7 @@ public static function getCsvData($data): Generator */ public static function loadTranslationFiles($extension) { - static $cache = array(); + static $cache = []; $extension = strtolower($extension); if (isset($cache[$extension])) { @@ -175,7 +175,7 @@ public static function getLogContentTypeParams($context) */ public static function getHumanReadableLogMessage($log, $generateLinks = true) { - static $links = array(); + static $links = []; $message = Text::_($log->message_language_key); $messageData = json_decode($log->message, true); @@ -242,7 +242,7 @@ public static function getContentTypeLink($component, $contentType, $id, $urlVar \JLoader::register($cName, $file); - if (class_exists($cName) && \is_callable(array($cName, 'getContentTypeLink'))) { + if (class_exists($cName) && \is_callable([$cName, 'getContentTypeLink'])) { return $cName::getContentTypeLink($contentType, $id, $object); } } @@ -273,18 +273,18 @@ public static function loadActionLogPluginsLanguage() $query = $db->getQuery(true) ->select( $db->quoteName( - array( + [ 'folder', 'element', 'params', 'extension_id' - ), - array( + ], + [ 'type', 'name', 'params', 'id' - ) + ] ) ) ->from($db->quoteName('#__extensions')) @@ -297,7 +297,7 @@ public static function loadActionLogPluginsLanguage() try { $rows = $db->loadObjectList(); } catch (\RuntimeException $e) { - $rows = array(); + $rows = []; } if (empty($rows)) { diff --git a/administrator/components/com_actionlogs/src/Model/ActionlogModel.php b/administrator/components/com_actionlogs/src/Model/ActionlogModel.php index 6914842cefeff..b0edc5b45d83b 100644 --- a/administrator/components/com_actionlogs/src/Model/ActionlogModel.php +++ b/administrator/components/com_actionlogs/src/Model/ActionlogModel.php @@ -62,7 +62,7 @@ public function addLog($messages, $messageLanguageKey, $context, $userId = null) $ip = 'COM_ACTIONLOGS_DISABLED'; } - $loggedMessages = array(); + $loggedMessages = []; foreach ($messages as $message) { $logMessage = new \stdClass(); @@ -112,7 +112,7 @@ protected function sendNotificationEmails($messages, $username, $context) $query = $db->getQuery(true); $query - ->select($db->quoteName(array('u.email', 'l.extensions'))) + ->select($db->quoteName(['u.email', 'l.extensions'])) ->from($db->quoteName('#__users', 'u')) ->where($db->quoteName('u.block') . ' = 0') ->join( @@ -125,7 +125,7 @@ protected function sendNotificationEmails($messages, $username, $context) $users = $db->loadObjectList(); - $recipients = array(); + $recipients = []; foreach ($users as $user) { $extensions = json_decode($user->extensions, true); diff --git a/administrator/components/com_actionlogs/src/Model/ActionlogsModel.php b/administrator/components/com_actionlogs/src/Model/ActionlogsModel.php index a04acdb62a4a9..fbdea7913fd13 100644 --- a/administrator/components/com_actionlogs/src/Model/ActionlogsModel.php +++ b/administrator/components/com_actionlogs/src/Model/ActionlogsModel.php @@ -44,10 +44,10 @@ class ActionlogsModel extends ListModel * * @throws Exception */ - public function __construct($config = array()) + public function __construct($config = []) { if (empty($config['filter_fields'])) { - $config['filter_fields'] = array( + $config['filter_fields'] = [ 'a.id', 'id', 'a.extension', 'extension', 'a.user_id', 'user', @@ -55,7 +55,7 @@ public function __construct($config = array()) 'a.log_date', 'log_date', 'a.ip_address', 'ip_address', 'dateRange', - ); + ]; } parent::__construct($config); @@ -217,7 +217,7 @@ private function buildDateRange($range) break; } - return array('dNow' => $dNow, 'dStart' => $dStart); + return ['dNow' => $dNow, 'dStart' => $dStart]; } /** @@ -347,7 +347,7 @@ public function delete(&$pks) return false; } - Factory::getApplication()->triggerEvent('onAfterLogPurge', array()); + Factory::getApplication()->triggerEvent('onAfterLogPurge', []); return true; } @@ -367,7 +367,7 @@ public function purge() return false; } - Factory::getApplication()->triggerEvent('onAfterLogPurge', array()); + Factory::getApplication()->triggerEvent('onAfterLogPurge', []); return true; } @@ -382,7 +382,7 @@ public function purge() * * @since 3.9.0 */ - public function getFilterForm($data = array(), $loadData = true) + public function getFilterForm($data = [], $loadData = true) { $form = parent::getFilterForm($data, $loadData); $params = ComponentHelper::getParams('com_actionlogs'); @@ -392,8 +392,8 @@ public function getFilterForm($data = array(), $loadData = true) if ($form && $ipLogging) { /* @var \Joomla\CMS\Form\Field\ListField $field */ $field = $form->getField('fullordering', 'list'); - $field->addOption(Text::_('COM_ACTIONLOGS_IP_ADDRESS_ASC'), array('value' => 'a.ip_address ASC')); - $field->addOption(Text::_('COM_ACTIONLOGS_IP_ADDRESS_DESC'), array('value' => 'a.ip_address DESC')); + $field->addOption(Text::_('COM_ACTIONLOGS_IP_ADDRESS_ASC'), ['value' => 'a.ip_address ASC']); + $field->addOption(Text::_('COM_ACTIONLOGS_IP_ADDRESS_DESC'), ['value' => 'a.ip_address DESC']); } return $form; diff --git a/administrator/components/com_actionlogs/tmpl/actionlogs/default.php b/administrator/components/com_actionlogs/tmpl/actionlogs/default.php index aad8da2a54a64..e8c22bbd6a7db 100644 --- a/administrator/components/com_actionlogs/tmpl/actionlogs/default.php +++ b/administrator/components/com_actionlogs/tmpl/actionlogs/default.php @@ -33,7 +33,7 @@
- $this)); ?> + $this]); ?> items)) : ?>
diff --git a/administrator/components/com_admin/postinstall/behindproxy.php b/administrator/components/com_admin/postinstall/behindproxy.php index f47852d5c88fc..c7acbc0756dfc 100644 --- a/administrator/components/com_admin/postinstall/behindproxy.php +++ b/administrator/components/com_admin/postinstall/behindproxy.php @@ -56,7 +56,7 @@ function admin_postinstall_behindproxy_condition() function behindproxy_postinstall_action() { $prev = ArrayHelper::fromObject(new JConfig()); - $data = array_merge($prev, array('behind_loadbalancer' => '1')); + $data = array_merge($prev, ['behind_loadbalancer' => '1']); $config = new Registry($data); @@ -71,7 +71,7 @@ function behindproxy_postinstall_action() } // Attempt to write the configuration file as a PHP class named JConfig. - $configuration = $config->toString('PHP', array('class' => 'JConfig', 'closingtag' => false)); + $configuration = $config->toString('PHP', ['class' => 'JConfig', 'closingtag' => false]); if (!File::write($file, $configuration)) { Factory::getApplication()->enqueueMessage(Text::_('COM_CONFIG_ERROR_WRITE_FAILED'), 'error'); diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index e172b8fcb4b4b..c6eb6d1c42610 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -85,7 +85,7 @@ public function update($installer) $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; $options['text_file'] = 'joomla_update.php'; - Log::addLogger($options, Log::INFO, array('Update', 'databasequery', 'jerror')); + Log::addLogger($options, Log::INFO, ['Update', 'databasequery', 'jerror']); try { Log::add(Text::_('COM_JOOMLAUPDATE_UPDATE_LOG_DELETE_FILES'), Log::INFO, 'Update'); @@ -539,7 +539,7 @@ protected function updateManifestCaches() // If we have the search package around, it may not have a manifest cache entry after upgrades from 3.x, so add it to the list if (File::exists(JPATH_ROOT . '/administrator/manifests/packages/pkg_search.xml')) { - $extensions[] = array('package', 'pkg_search', '', 0); + $extensions[] = ['package', 'pkg_search', '', 0]; } // Attempt to refresh manifest caches @@ -599,7 +599,7 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false) 'files_checked' => [], ]; - $files = array( + $files = [ // From 3.10 to 4.1 '/administrator/components/com_actionlogs/actionlogs.php', '/administrator/components/com_actionlogs/controller.php', @@ -6463,9 +6463,9 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false) '/media/vendor/hotkeys.js/LICENSE', // From 4.2.1 to 4.2.2 '/administrator/cache/fido.jwt', - ); + ]; - $folders = array( + $folders = [ // From 3.10 to 4.1 '/templates/system/images', '/templates/system/html', @@ -7837,7 +7837,7 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false) '/media/vendor/hotkeys.js/js', '/media/vendor/hotkeys.js', '/libraries/vendor/symfony/string/Resources/bin', - ); + ]; $status['files_checked'] = $files; $status['folders_checked'] = $folders; @@ -7910,9 +7910,9 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false) public function updateAssets($installer) { // List all components added since 4.0 - $newComponents = array( + $newComponents = [ // Components to be added here - ); + ]; foreach ($newComponents as $component) { /** @var \Joomla\CMS\Table\Asset $asset */ @@ -8562,13 +8562,13 @@ private function updateContentTypes(): void */ protected function fixFilenameCasing() { - $files = array( + $files = [ // 3.10 changes '/libraries/src/Filesystem/Support/Stringcontroller.php' => '/libraries/src/Filesystem/Support/StringController.php', '/libraries/src/Form/Rule/SubFormRule.php' => '/libraries/src/Form/Rule/SubformRule.php', // 4.0.0 '/media/vendor/skipto/js/skipTo.js' => '/media/vendor/skipto/js/skipto.js', - ); + ]; foreach ($files as $old => $expected) { $oldRealpath = realpath(JPATH_ROOT . $old); diff --git a/administrator/components/com_admin/src/Controller/DisplayController.php b/administrator/components/com_admin/src/Controller/DisplayController.php index 293adf073aecf..7d4d97c91c56c 100644 --- a/administrator/components/com_admin/src/Controller/DisplayController.php +++ b/administrator/components/com_admin/src/Controller/DisplayController.php @@ -33,7 +33,7 @@ class DisplayController extends BaseController * * @since 3.9 */ - public function display($cachable = false, $urlparams = array()) + public function display($cachable = false, $urlparams = []) { $viewName = $this->input->get('view', $this->default_view); $format = $this->input->get('format', 'html'); diff --git a/administrator/components/com_admin/src/Model/HelpModel.php b/administrator/components/com_admin/src/Model/HelpModel.php index f3b8b7d862110..4e341cc90f83c 100644 --- a/administrator/components/com_admin/src/Model/HelpModel.php +++ b/administrator/components/com_admin/src/Model/HelpModel.php @@ -153,7 +153,7 @@ public function &getToc() // Get Help files $files = Folder::files(JPATH_BASE . '/help/' . $lang_tag, '\.xml$|\.html$'); - $this->toc = array(); + $this->toc = []; foreach ($files as $file) { $buffer = file_get_contents(JPATH_BASE . '/help/' . $lang_tag . '/' . $file); diff --git a/administrator/components/com_associations/layouts/joomla/searchtools/default.php b/administrator/components/com_associations/layouts/joomla/searchtools/default.php index 91ee344814ea9..0bd215d147204 100644 --- a/administrator/components/com_associations/layouts/joomla/searchtools/default.php +++ b/administrator/components/com_associations/layouts/joomla/searchtools/default.php @@ -18,7 +18,7 @@ $data = $displayData; // Receive overridable options -$data['options'] = !empty($data['options']) ? $data['options'] : array(); +$data['options'] = !empty($data['options']) ? $data['options'] : []; $noResultsText = ''; $hideActiveFilters = false; @@ -58,7 +58,7 @@ } // Set some basic options. -$customOptions = array( +$customOptions = [ 'filtersHidden' => isset($data['options']['filtersHidden']) && $data['options']['filtersHidden'] ? $data['options']['filtersHidden'] : $hideActiveFilters, 'filterButton' => isset($data['options']['filterButton']) && $data['options']['filterButton'] ? $data['options']['filterButton'] : $showFilterButton, 'defaultLimit' => $data['options']['defaultLimit'] ?? Factory::getApplication()->get('list_limit', 20), @@ -69,7 +69,7 @@ 'showNoResults' => !empty($noResultsText), 'noResultsText' => !empty($noResultsText) ? $noResultsText : '', 'formSelector' => !empty($data['options']['formSelector']) ? $data['options']['formSelector'] : '#adminForm', -); +]; // Merge custom options in the options array. $data['options'] = array_merge($customOptions, $data['options']); diff --git a/administrator/components/com_associations/src/Controller/AssociationController.php b/administrator/components/com_associations/src/Controller/AssociationController.php index 5bf36d276086b..4180de316d17f 100644 --- a/administrator/components/com_associations/src/Controller/AssociationController.php +++ b/administrator/components/com_associations/src/Controller/AssociationController.php @@ -71,7 +71,7 @@ public function cancel($key = null) // Only check in, if component item type allows to check out. if (AssociationsHelper::typeSupportsCheckout($extensionName, $typeName)) { - $ids = array(); + $ids = []; $targetId = $this->input->get('target-id', '', 'string'); if ($targetId !== '') { diff --git a/administrator/components/com_associations/src/Controller/AssociationsController.php b/administrator/components/com_associations/src/Controller/AssociationsController.php index 948adcfb995db..dd24dad3cd972 100644 --- a/administrator/components/com_associations/src/Controller/AssociationsController.php +++ b/administrator/components/com_associations/src/Controller/AssociationsController.php @@ -46,7 +46,7 @@ class AssociationsController extends AdminController * * @since 3.7.0 */ - public function getModel($name = 'Associations', $prefix = 'Administrator', $config = array('ignore_request' => true)) + public function getModel($name = 'Associations', $prefix = 'Administrator', $config = ['ignore_request' => true]) { return parent::getModel($name, $prefix, $config); } @@ -108,7 +108,7 @@ public function checkin() return; } - $cid = (array) $this->input->get('cid', array(), 'int'); + $cid = (array) $this->input->get('cid', [], 'int'); if (empty($cid)) { // Seems we don't have an id to work with. diff --git a/administrator/components/com_associations/src/Field/ItemlanguageField.php b/administrator/components/com_associations/src/Field/ItemlanguageField.php index 79230d581f075..114fe3bdfc7df 100644 --- a/administrator/components/com_associations/src/Field/ItemlanguageField.php +++ b/administrator/components/com_associations/src/Field/ItemlanguageField.php @@ -63,9 +63,9 @@ protected function getOptions() $canCreate = AssociationsHelper::allowAdd($extensionName, $typeName); // Gets existing languages. - $existingLanguages = LanguageHelper::getContentLanguages(array(0, 1), false); + $existingLanguages = LanguageHelper::getContentLanguages([0, 1], false); - $options = array(); + $options = []; // Each option has the format "|", example: "en-GB|1" foreach ($existingLanguages as $langCode => $language) { diff --git a/administrator/components/com_associations/src/Field/ItemtypeField.php b/administrator/components/com_associations/src/Field/ItemtypeField.php index 601e0fdddc4db..012fe5fced9c6 100644 --- a/administrator/components/com_associations/src/Field/ItemtypeField.php +++ b/administrator/components/com_associations/src/Field/ItemtypeField.php @@ -45,7 +45,7 @@ class ItemtypeField extends GroupedlistField */ protected function getGroups() { - $options = array(); + $options = []; $extensions = AssociationsHelper::getSupportedExtensions(); foreach ($extensions as $extension) { diff --git a/administrator/components/com_associations/src/Field/Modal/AssociationField.php b/administrator/components/com_associations/src/Field/Modal/AssociationField.php index 5238418dfdf2b..67aacacc552e0 100644 --- a/administrator/components/com_associations/src/Field/Modal/AssociationField.php +++ b/administrator/components/com_associations/src/Field/Modal/AssociationField.php @@ -55,7 +55,7 @@ protected function getInput() $wa->useScript('com_associations.admin-associations-modal'); // Setup variables for display. - $html = array(); + $html = []; $linkAssociations = 'index.php?option=com_associations&view=associations&layout=modal&tmpl=component' . '&forcedItemType=' . Factory::getApplication()->input->get('itemtype', '', 'string') . '&function=jSelectAssociation_' . $this->id; @@ -92,7 +92,7 @@ protected function getInput() $html[] = HTMLHelper::_( 'bootstrap.renderModal', 'associationSelect' . $this->id . 'Modal', - array( + [ 'title' => Text::_('COM_ASSOCIATIONS_SELECT_TARGET'), 'backdrop' => 'static', 'url' => $urlSelect, @@ -102,7 +102,7 @@ protected function getInput() 'modalWidth' => 80, 'footer' => '', - ) + ] ); return implode("\n", $html); diff --git a/administrator/components/com_associations/src/Helper/AssociationsHelper.php b/administrator/components/com_associations/src/Helper/AssociationsHelper.php index 2b5d707491677..9e32fa6996a2f 100644 --- a/administrator/components/com_associations/src/Helper/AssociationsHelper.php +++ b/administrator/components/com_associations/src/Helper/AssociationsHelper.php @@ -46,7 +46,7 @@ class AssociationsHelper extends ContentHelper * @var array * @since 3.7.0 */ - public static $supportedExtensionsList = array(); + public static $supportedExtensionsList = []; /** * Get the associated items for an item @@ -62,7 +62,7 @@ class AssociationsHelper extends ContentHelper public static function getAssociationList($extensionName, $typeName, $itemId) { if (!self::hasSupport($extensionName)) { - return array(); + return []; } // Get the extension specific helper method @@ -218,7 +218,7 @@ public static function getAssociationHtmlList($extensionName, $typeName, $itemId $titleFieldName = self::getTypeFieldName($extensionName, $typeName, 'title'); // Get all content languages. - $languages = LanguageHelper::getContentLanguages(array(0, 1), false); + $languages = LanguageHelper::getContentLanguages([0, 1], false); $content_languages = array_column($languages, 'lang_code'); // Display warning if Content Language is trashed or deleted @@ -292,7 +292,7 @@ public static function getAssociationHtmlList($extensionName, $typeName, $itemId $additional .= $addLink && $allow ? Text::_('COM_ASSOCIATIONS_EDIT_ASSOCIATION') : ''; } else { - $items[$langCode] = array(); + $items[$langCode] = []; $title = Text::_('COM_ASSOCIATIONS_NO_ASSOCIATION'); $additional = $addLink ? Text::_('COM_ASSOCIATIONS_ADD_NEW_ASSOCIATION') : ''; @@ -302,7 +302,7 @@ public static function getAssociationHtmlList($extensionName, $typeName, $itemId } // Generate item Html. - $options = array( + $options = [ 'option' => 'com_associations', 'view' => 'association', 'layout' => 'edit', @@ -310,7 +310,7 @@ public static function getAssociationHtmlList($extensionName, $typeName, $itemId 'task' => 'association.edit', 'id' => $itemId, 'target' => $target, - ); + ]; $url = Route::_('index.php?' . http_build_query($options)); $url = $allow && $addLink ? $url : ''; @@ -340,7 +340,7 @@ public static function getSupportedExtensions() return self::$extensionsSupport; } - self::$extensionsSupport = array(); + self::$extensionsSupport = []; $extensions = self::getEnabledExtensions(); @@ -401,7 +401,7 @@ public static function getSupportedExtension($extensionName) // Get the supported types $types = $helper->getItemTypes(); - $rTypes = array(); + $rTypes = []; foreach ($types as $typeName) { $details = $helper->getType($typeName); @@ -468,7 +468,7 @@ private static function getEnabledExtensions() */ public static function getContentLanguages() { - return LanguageHelper::getContentLanguages(array(0, 1)); + return LanguageHelper::getContentLanguages([0, 1]); } /** diff --git a/administrator/components/com_associations/src/Model/AssociationModel.php b/administrator/components/com_associations/src/Model/AssociationModel.php index 1e66ed243de78..1f366ecf36ead 100644 --- a/administrator/components/com_associations/src/Model/AssociationModel.php +++ b/administrator/components/com_associations/src/Model/AssociationModel.php @@ -33,10 +33,10 @@ class AssociationModel extends ListModel * * @since 3.7.0 */ - public function getForm($data = array(), $loadData = true) + public function getForm($data = [], $loadData = true) { // Get the form. - $form = $this->loadForm('com_associations.association', 'association', array('control' => 'jform', 'load_data' => $loadData)); + $form = $this->loadForm('com_associations.association', 'association', ['control' => 'jform', 'load_data' => $loadData]); return !empty($form) ? $form : false; } diff --git a/administrator/components/com_associations/src/Model/AssociationsModel.php b/administrator/components/com_associations/src/Model/AssociationsModel.php index 37de1add382e5..f76f8edeaf7f2 100644 --- a/administrator/components/com_associations/src/Model/AssociationsModel.php +++ b/administrator/components/com_associations/src/Model/AssociationsModel.php @@ -39,10 +39,10 @@ class AssociationsModel extends ListModel * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.7 */ - public function __construct($config = array(), MVCFactoryInterface $factory = null) + public function __construct($config = [], MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { - $config['filter_fields'] = array( + $config['filter_fields'] = [ 'id', 'title', 'ordering', @@ -57,7 +57,7 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu 'category_title', 'access', 'access_level', - ); + ]; } parent::__construct($config, $factory); @@ -244,14 +244,14 @@ protected function getListQuery() ->bind(':context', $extensionNameItem); // Prepare the group by clause. - $groupby = array( + $groupby = [ $fields['id'], $fields['title'], $fields['alias'], $fields['language'], 'l.title', 'l.image', - ); + ]; // Select author for ACL checks. if (!empty($fields['created_user_id'])) { diff --git a/administrator/components/com_associations/src/View/Associations/HtmlView.php b/administrator/components/com_associations/src/View/Associations/HtmlView.php index 54c7c230c3de8..a39ca1f1c5588 100644 --- a/administrator/components/com_associations/src/View/Associations/HtmlView.php +++ b/administrator/components/com_associations/src/View/Associations/HtmlView.php @@ -103,8 +103,8 @@ public function display($tpl = null) } else { $this->extensionName = $extensionName; $this->typeName = $typeName; - $this->typeSupports = array(); - $this->typeFields = array(); + $this->typeSupports = []; + $this->typeFields = []; $details = $type->get('details'); @@ -164,11 +164,11 @@ public function display($tpl = null) $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); - $linkParameters = array( + $linkParameters = [ 'layout' => 'edit', 'itemtype' => $extensionName . '.' . $typeName, 'task' => 'association.edit', - ); + ]; $this->editUri = 'index.php?option=com_associations&view=association&' . http_build_query($linkParameters); } diff --git a/administrator/components/com_associations/tmpl/associations/default.php b/administrator/components/com_associations/tmpl/associations/default.php index ec539fed43377..43ffc9f124e7e 100644 --- a/administrator/components/com_associations/tmpl/associations/default.php +++ b/administrator/components/com_associations/tmpl/associations/default.php @@ -27,12 +27,12 @@ $listDirn = $this->escape($this->state->get('list.direction')); $canManageCheckin = Factory::getUser()->authorise('core.manage', 'com_checkin'); -$iconStates = array( +$iconStates = [ -2 => 'icon-trash', 0 => 'icon-times', 1 => 'icon-check', 2 => 'icon-folder', -); +]; Text::script('COM_ASSOCIATIONS_PURGE_CONFIRM_PROMPT', true); @@ -41,7 +41,7 @@
- $this)); ?> + $this]); ?> state->get('itemtype') == '' || $this->state->get('language') == '') : ?>
@@ -109,7 +109,7 @@
level)) : ?> - $item->level)); ?> + $item->level]); ?> editor, $item->checked_out_time, 'associations.', $canCheckin); ?> diff --git a/administrator/components/com_associations/tmpl/associations/modal.php b/administrator/components/com_associations/tmpl/associations/modal.php index 398e271296b1c..972521b10d9e3 100644 --- a/administrator/components/com_associations/tmpl/associations/modal.php +++ b/administrator/components/com_associations/tmpl/associations/modal.php @@ -34,12 +34,12 @@ $listDirn = $this->escape($this->state->get('list.direction')); $canManageCheckin = Factory::getUser()->authorise('core.manage', 'com_checkin'); -$iconStates = array( +$iconStates = [ -2 => 'icon-trash', 0 => 'icon-times', 1 => 'icon-check', 2 => 'icon-folder', -); +]; $this->document->addScriptOptions('associations-modal', ['func' => $function]); @@ -47,7 +47,7 @@
- $this)); ?> + $this]); ?> items)) : ?>
@@ -107,7 +107,7 @@ level)) : ?> - $item->level)); ?> + $item->level]); ?> diff --git a/administrator/components/com_banners/src/Controller/BannerController.php b/administrator/components/com_banners/src/Controller/BannerController.php index 195b04fcd7b7d..e221e16668f19 100644 --- a/administrator/components/com_banners/src/Controller/BannerController.php +++ b/administrator/components/com_banners/src/Controller/BannerController.php @@ -45,7 +45,7 @@ class BannerController extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { $filter = $this->input->getInt('filter_category_id'); $categoryId = ArrayHelper::getValue($data, 'catid', $filter, 'int'); @@ -69,7 +69,7 @@ protected function allowAdd($data = array()) * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { $recordId = (int) isset($data[$key]) ? $data[$key] : 0; $categoryId = 0; @@ -101,7 +101,7 @@ public function batch($model = null) $this->checkToken(); // Set the model - $model = $this->getModel('Banner', '', array()); + $model = $this->getModel('Banner', '', []); // Preset the redirect $this->setRedirect(Route::_('index.php?option=com_banners&view=banners' . $this->getRedirectToListAppend(), false)); diff --git a/administrator/components/com_banners/src/Controller/BannersController.php b/administrator/components/com_banners/src/Controller/BannersController.php index 363c700d67c14..fbe1594dd45ba 100644 --- a/administrator/components/com_banners/src/Controller/BannersController.php +++ b/administrator/components/com_banners/src/Controller/BannersController.php @@ -46,7 +46,7 @@ class BannersController extends AdminController * * @since 3.0 */ - public function __construct($config = array(), MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); @@ -64,7 +64,7 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu * * @since 1.6 */ - public function getModel($name = 'Banner', $prefix = 'Administrator', $config = array('ignore_request' => true)) + public function getModel($name = 'Banner', $prefix = 'Administrator', $config = ['ignore_request' => true]) { return parent::getModel($name, $prefix, $config); } @@ -81,8 +81,8 @@ public function sticky_publish() // Check for request forgeries. $this->checkToken(); - $ids = (array) $this->input->get('cid', array(), 'int'); - $values = array('sticky_publish' => 1, 'sticky_unpublish' => 0); + $ids = (array) $this->input->get('cid', [], 'int'); + $values = ['sticky_publish' => 1, 'sticky_unpublish' => 0]; $task = $this->getTask(); $value = ArrayHelper::getValue($values, $task, 0, 'int'); diff --git a/administrator/components/com_banners/src/Controller/ClientsController.php b/administrator/components/com_banners/src/Controller/ClientsController.php index a9e6d4a7893dd..9a73d182ae412 100644 --- a/administrator/components/com_banners/src/Controller/ClientsController.php +++ b/administrator/components/com_banners/src/Controller/ClientsController.php @@ -42,7 +42,7 @@ class ClientsController extends AdminController * * @since 1.6 */ - public function getModel($name = 'Client', $prefix = 'Administrator', $config = array('ignore_request' => true)) + public function getModel($name = 'Client', $prefix = 'Administrator', $config = ['ignore_request' => true]) { return parent::getModel($name, $prefix, $config); } diff --git a/administrator/components/com_banners/src/Controller/DisplayController.php b/administrator/components/com_banners/src/Controller/DisplayController.php index 95cee5caaa747..72a595c51c13a 100644 --- a/administrator/components/com_banners/src/Controller/DisplayController.php +++ b/administrator/components/com_banners/src/Controller/DisplayController.php @@ -44,7 +44,7 @@ class DisplayController extends BaseController * * @since 1.5 */ - public function display($cachable = false, $urlparams = array()) + public function display($cachable = false, $urlparams = []) { BannersHelper::updateReset(); diff --git a/administrator/components/com_banners/src/Controller/TracksController.php b/administrator/components/com_banners/src/Controller/TracksController.php index b7059415553b9..9ea8779556f70 100644 --- a/administrator/components/com_banners/src/Controller/TracksController.php +++ b/administrator/components/com_banners/src/Controller/TracksController.php @@ -44,7 +44,7 @@ class TracksController extends BaseController * * @since 1.6 */ - public function getModel($name = 'Tracks', $prefix = 'Administrator', $config = array('ignore_request' => true)) + public function getModel($name = 'Tracks', $prefix = 'Administrator', $config = ['ignore_request' => true]) { return parent::getModel($name, $prefix, $config); } @@ -99,7 +99,7 @@ public function delete() * @since 1.5 * @todo This should be done as a view, not here! */ - public function display($cachable = false, $urlparams = array()) + public function display($cachable = false, $urlparams = []) { // Get the document object. $vName = 'tracks'; @@ -124,7 +124,7 @@ public function display($cachable = false, $urlparams = array()) $model->setState('list.limit', 0); $model->setState('list.start', 0); - $form = $this->input->get('jform', array(), 'array'); + $form = $this->input->get('jform', [], 'array'); $model->setState('basename', $form['basename']); $model->setState('compressed', $form['compressed']); diff --git a/administrator/components/com_banners/src/Helper/BannersHelper.php b/administrator/components/com_banners/src/Helper/BannersHelper.php index 81e9efdad9e93..53dda5686a107 100644 --- a/administrator/components/com_banners/src/Helper/BannersHelper.php +++ b/administrator/components/com_banners/src/Helper/BannersHelper.php @@ -145,7 +145,7 @@ public static function updateReset() */ public static function getClientOptions() { - $options = array(); + $options = []; $db = Factory::getDbo(); $query = $db->getQuery(true) diff --git a/administrator/components/com_banners/src/Model/BannerModel.php b/administrator/components/com_banners/src/Model/BannerModel.php index 307b8896082c7..98230db5c93b5 100644 --- a/administrator/components/com_banners/src/Model/BannerModel.php +++ b/administrator/components/com_banners/src/Model/BannerModel.php @@ -59,10 +59,10 @@ class BannerModel extends AdminModel * * @var array */ - protected $batch_commands = array( + protected $batch_commands = [ 'client_id' => 'batchClient', 'language_id' => 'batchLanguage' - ); + ]; /** * Batch client changes for a group of banners. @@ -178,10 +178,10 @@ protected function canEditState($record) * * @since 1.6 */ - public function getForm($data = array(), $loadData = true) + public function getForm($data = [], $loadData = true) { // Get the form. - $form = $this->loadForm('com_banners.banner', 'banner', array('control' => 'jform', 'load_data' => $loadData)); + $form = $this->loadForm('com_banners.banner', 'banner', ['control' => 'jform', 'load_data' => $loadData]); if (empty($form)) { return false; @@ -224,7 +224,7 @@ protected function loadFormData() { // Check the session for previously entered form data. $app = Factory::getApplication(); - $data = $app->getUserState('com_banners.edit.banner.data', array()); + $data = $app->getUserState('com_banners.edit.banner.data', []); if (empty($data)) { $data = $this->getItem(); diff --git a/administrator/components/com_banners/src/Model/BannersModel.php b/administrator/components/com_banners/src/Model/BannersModel.php index 16186d863712b..5f7683b26f0e3 100644 --- a/administrator/components/com_banners/src/Model/BannersModel.php +++ b/administrator/components/com_banners/src/Model/BannersModel.php @@ -33,10 +33,10 @@ class BannersModel extends ListModel * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { if (empty($config['filter_fields'])) { - $config['filter_fields'] = array( + $config['filter_fields'] = [ 'id', 'a.id', 'cid', 'a.cid', 'client_name', 'name', 'a.name', @@ -58,7 +58,7 @@ public function __construct($config = array()) 'category_id', 'published', 'level', 'c.level', - ); + ]; } parent::__construct($config); @@ -257,7 +257,7 @@ protected function getStoreId($id = '') * * @since 1.6 */ - public function getTable($type = 'Banner', $prefix = 'Administrator', $config = array()) + public function getTable($type = 'Banner', $prefix = 'Administrator', $config = []) { return parent::getTable($type, $prefix, $config); } diff --git a/administrator/components/com_banners/src/Model/ClientModel.php b/administrator/components/com_banners/src/Model/ClientModel.php index c67db6042c07c..49530c78e749a 100644 --- a/administrator/components/com_banners/src/Model/ClientModel.php +++ b/administrator/components/com_banners/src/Model/ClientModel.php @@ -89,10 +89,10 @@ protected function canEditState($record) * * @since 1.6 */ - public function getForm($data = array(), $loadData = true) + public function getForm($data = [], $loadData = true) { // Get the form. - $form = $this->loadForm('com_banners.client', 'client', array('control' => 'jform', 'load_data' => $loadData)); + $form = $this->loadForm('com_banners.client', 'client', ['control' => 'jform', 'load_data' => $loadData]); if (empty($form)) { return false; @@ -111,7 +111,7 @@ public function getForm($data = array(), $loadData = true) protected function loadFormData() { // Check the session for previously entered form data. - $data = Factory::getApplication()->getUserState('com_banners.edit.client.data', array()); + $data = Factory::getApplication()->getUserState('com_banners.edit.client.data', []); if (empty($data)) { $data = $this->getItem(); diff --git a/administrator/components/com_banners/src/Model/ClientsModel.php b/administrator/components/com_banners/src/Model/ClientsModel.php index 38bbe308b0f1b..5ae41c93df78a 100644 --- a/administrator/components/com_banners/src/Model/ClientsModel.php +++ b/administrator/components/com_banners/src/Model/ClientsModel.php @@ -32,10 +32,10 @@ class ClientsModel extends ListModel * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { if (empty($config['filter_fields'])) { - $config['filter_fields'] = array( + $config['filter_fields'] = [ 'id', 'a.id', 'name', 'a.name', 'contact', 'a.contact', @@ -43,7 +43,7 @@ public function __construct($config = array()) 'checked_out', 'a.checked_out', 'checked_out_time', 'a.checked_out_time', 'purchase_type', 'a.purchase_type' - ); + ]; } parent::__construct($config); @@ -214,7 +214,7 @@ public function getItems() // If empty or an error, just return. if (empty($items)) { - return array(); + return []; } // Getting the following metric by joins is WAY TOO SLOW. diff --git a/administrator/components/com_banners/src/Model/DownloadModel.php b/administrator/components/com_banners/src/Model/DownloadModel.php index a93fdeef5e1ac..934586caa967c 100644 --- a/administrator/components/com_banners/src/Model/DownloadModel.php +++ b/administrator/components/com_banners/src/Model/DownloadModel.php @@ -59,10 +59,10 @@ protected function populateState() * * @since 1.6 */ - public function getForm($data = array(), $loadData = true) + public function getForm($data = [], $loadData = true) { // Get the form. - $form = $this->loadForm('com_banners.download', 'download', array('control' => 'jform', 'load_data' => $loadData)); + $form = $this->loadForm('com_banners.download', 'download', ['control' => 'jform', 'load_data' => $loadData]); if (empty($form)) { return false; @@ -80,10 +80,10 @@ public function getForm($data = array(), $loadData = true) */ protected function loadFormData() { - $data = (object) array( + $data = (object) [ 'basename' => $this->getState('basename'), 'compressed' => $this->getState('compressed'), - ); + ]; $this->preprocessData('com_banners.download', $data); diff --git a/administrator/components/com_banners/src/Model/TracksModel.php b/administrator/components/com_banners/src/Model/TracksModel.php index bd7c25f4bffcf..b5666bb293e85 100644 --- a/administrator/components/com_banners/src/Model/TracksModel.php +++ b/administrator/components/com_banners/src/Model/TracksModel.php @@ -46,10 +46,10 @@ class TracksModel extends ListModel * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { if (empty($config['filter_fields'])) { - $config['filter_fields'] = array( + $config['filter_fields'] = [ 'b.name', 'banner_name', 'cl.name', 'client_name', 'client_id', 'c.title', 'category_title', 'category_id', @@ -57,7 +57,7 @@ public function __construct($config = array()) 'count', 'a.count', 'track_date', 'a.track_date', 'end', 'begin', 'level', 'c.level', - ); + ]; } parent::__construct($config); @@ -278,7 +278,7 @@ public function getBaseName() $categoryName = $this->getCategoryName(); $basename = str_replace('__CATNAME__', $categoryName, $basename); } else { - $basename = str_replace(array('__CATID__', '__CATNAME__'), '', $basename); + $basename = str_replace(['__CATID__', '__CATNAME__'], '', $basename); } $clientId = $this->getState('filter.client_id'); @@ -293,7 +293,7 @@ public function getBaseName() $clientName = $this->getClientName(); $basename = str_replace('__CLIENTNAME__', $clientName, $basename); } else { - $basename = str_replace(array('__CLIENTID__', '__CLIENTNAME__'), '', $basename); + $basename = str_replace(['__CLIENTID__', '__CLIENTNAME__'], '', $basename); } $type = $this->getState('filter.type'); @@ -303,7 +303,7 @@ public function getBaseName() $typeName = Text::_('COM_BANNERS_TYPE' . $type); $basename = str_replace('__TYPENAME__', $typeName, $basename); } else { - $basename = str_replace(array('__TYPE__', '__TYPENAME__'), '', $basename); + $basename = str_replace(['__TYPE__', '__TYPENAME__'], '', $basename); } $begin = $this->getState('filter.begin'); @@ -449,13 +449,13 @@ public function getContent() if ($this->getState('compressed')) { $app = Factory::getApplication(); - $files = array( - 'track' => array( + $files = [ + 'track' => [ 'name' => $this->getBaseName() . '.csv', 'data' => $this->content, 'time' => time() - ) - ); + ] + ]; $ziproot = $app->get('tmp_path') . '/' . uniqid('banners_tracks_') . '.zip'; // Run the packager diff --git a/administrator/components/com_banners/src/Service/Html/Banner.php b/administrator/components/com_banners/src/Service/Html/Banner.php index 7ca56fa44ca3c..d463d2266d460 100644 --- a/administrator/components/com_banners/src/Service/Html/Banner.php +++ b/administrator/components/com_banners/src/Service/Html/Banner.php @@ -40,7 +40,7 @@ public function clients() // Create the batch selector to change the client on a selection list. return implode( "\n", - array( + [ '', @@ -49,7 +49,7 @@ public function clients() '', HTMLHelper::_('select.options', static::clientlist(), 'value', 'text'), '' - ) + ] ); } @@ -100,8 +100,8 @@ public function clientlist() */ public function pinned($value, $i, $enabled = true, $checkbox = 'cb') { - $states = array( - 1 => array( + $states = [ + 1 => [ 'sticky_unpublish', 'COM_BANNERS_BANNERS_PINNED', 'COM_BANNERS_BANNERS_HTML_PIN_BANNER', @@ -109,8 +109,8 @@ public function pinned($value, $i, $enabled = true, $checkbox = 'cb') true, 'publish', 'publish' - ), - 0 => array( + ], + 0 => [ 'sticky_publish', 'COM_BANNERS_BANNERS_UNPINNED', 'COM_BANNERS_BANNERS_HTML_UNPIN_BANNER', @@ -118,8 +118,8 @@ public function pinned($value, $i, $enabled = true, $checkbox = 'cb') true, 'unpublish', 'unpublish' - ), - ); + ], + ]; return HTMLHelper::_('jgrid.state', $states, $value, $i, 'banners.', $enabled, true, $checkbox); } diff --git a/administrator/components/com_banners/src/Table/BannerTable.php b/administrator/components/com_banners/src/Table/BannerTable.php index 90d50365f344b..d98954985fbc2 100644 --- a/administrator/components/com_banners/src/Table/BannerTable.php +++ b/administrator/components/com_banners/src/Table/BannerTable.php @@ -167,7 +167,7 @@ public function check() * * @since 1.5 */ - public function bind($array, $ignore = array()) + public function bind($array, $ignore = []) { if (isset($array['params']) && \is_array($array['params'])) { $registry = new Registry($array['params']); @@ -253,7 +253,7 @@ public function store($updateNulls = true) } else { // Get the old row /** @var BannerTable $oldrow */ - $oldrow = Table::getInstance('BannerTable', __NAMESPACE__ . '\\', array('dbo' => $db)); + $oldrow = Table::getInstance('BannerTable', __NAMESPACE__ . '\\', ['dbo' => $db]); if (!$oldrow->load($this->id) && $oldrow->getError()) { $this->setError($oldrow->getError()); @@ -261,9 +261,9 @@ public function store($updateNulls = true) // Verify that the alias is unique /** @var BannerTable $table */ - $table = Table::getInstance('BannerTable', __NAMESPACE__ . '\\', array('dbo' => $db)); + $table = Table::getInstance('BannerTable', __NAMESPACE__ . '\\', ['dbo' => $db]); - if ($table->load(array('alias' => $this->alias, 'catid' => $this->catid)) && ($table->id != $this->id || $this->id == 0)) { + if ($table->load(['alias' => $this->alias, 'catid' => $this->catid]) && ($table->id != $this->id || $this->id == 0)) { $this->setError(Text::_('COM_BANNERS_ERROR_UNIQUE_ALIAS')); return false; @@ -307,7 +307,7 @@ public function stick($pks = null, $state = 1, $userId = 0) // If there are no primary keys set check to see if the instance key is set. if (empty($pks)) { if ($this->$k) { - $pks = array($this->$k); + $pks = [$this->$k]; } else { // Nothing to set publishing state on, return false. $this->setError(Text::_('JLIB_DATABASE_ERROR_NO_ROWS_SELECTED')); @@ -318,7 +318,7 @@ public function stick($pks = null, $state = 1, $userId = 0) // Get an instance of the table /** @var BannerTable $table */ - $table = Table::getInstance('BannerTable', __NAMESPACE__ . '\\', array('dbo' => $this->_db)); + $table = Table::getInstance('BannerTable', __NAMESPACE__ . '\\', ['dbo' => $this->_db]); // For all keys foreach ($pks as $pk) { diff --git a/administrator/components/com_cache/src/Controller/DisplayController.php b/administrator/components/com_cache/src/Controller/DisplayController.php index 67a2290d82d56..e3039c1e9dd9a 100644 --- a/administrator/components/com_cache/src/Controller/DisplayController.php +++ b/administrator/components/com_cache/src/Controller/DisplayController.php @@ -77,14 +77,14 @@ public function delete() // Check for request forgeries $this->checkToken(); - $cid = (array) $this->input->post->get('cid', array(), 'string'); + $cid = (array) $this->input->post->get('cid', [], 'string'); if (empty($cid)) { $this->app->enqueueMessage(Text::_('JERROR_NO_ITEMS_SELECTED'), 'warning'); } else { $result = $this->getModel('cache')->cleanlist($cid); - if ($result !== array()) { + if ($result !== []) { $this->app->enqueueMessage(Text::sprintf('COM_CACHE_EXPIRED_ITEMS_DELETE_ERROR', implode(', ', $result)), 'error'); } else { $this->app->enqueueMessage(Text::_('COM_CACHE_EXPIRED_ITEMS_HAVE_BEEN_DELETED'), 'message'); @@ -131,7 +131,7 @@ public function deleteAll() $this->app->enqueueMessage(Text::_('COM_CACHE_MSG_SOME_CACHE_GROUPS_CLEARED'), 'warning'); } - $this->app->triggerEvent('onAfterPurge', array()); + $this->app->triggerEvent('onAfterPurge', []); $this->setRedirect('index.php?option=com_cache&view=cache'); } diff --git a/administrator/components/com_cache/src/Model/CacheModel.php b/administrator/components/com_cache/src/Model/CacheModel.php index 09674652a9fe6..08520d8ced946 100644 --- a/administrator/components/com_cache/src/Model/CacheModel.php +++ b/administrator/components/com_cache/src/Model/CacheModel.php @@ -36,7 +36,7 @@ class CacheModel extends ListModel * * @var array */ - protected $_data = array(); + protected $_data = []; /** * Group total @@ -59,15 +59,15 @@ class CacheModel extends ListModel * * @since 3.5 */ - public function __construct($config = array()) + public function __construct($config = []) { if (empty($config['filter_fields'])) { - $config['filter_fields'] = array( + $config['filter_fields'] = [ 'group', 'count', 'size', 'client_id', - ); + ]; } parent::__construct($config); @@ -151,14 +151,14 @@ public function getData() return \array_slice($this->_data, $start, $limit); } } else { - $this->_data = array(); + $this->_data = []; } } catch (CacheConnectingException $exception) { $this->setError(Text::_('COM_CACHE_ERROR_CACHE_CONNECTION_FAILED')); - $this->_data = array(); + $this->_data = []; } catch (UnsupportedCacheException $exception) { $this->setError(Text::_('COM_CACHE_ERROR_CACHE_DRIVER_UNSUPPORTED')); - $this->_data = array(); + $this->_data = []; } } @@ -174,12 +174,12 @@ public function getCache() { $app = Factory::getApplication(); - $options = array( + $options = [ 'defaultgroup' => '', 'storage' => $app->get('cache_handler', ''), 'caching' => true, 'cachebase' => $app->get('cache_path', JPATH_CACHE) - ); + ]; return Cache::getInstance('', $options); } @@ -230,7 +230,7 @@ public function clean($group = '') return false; } - Factory::getApplication()->triggerEvent('onAfterPurge', array($group)); + Factory::getApplication()->triggerEvent('onAfterPurge', [$group]); return true; } @@ -244,7 +244,7 @@ public function clean($group = '') */ public function cleanlist($array) { - $errors = array(); + $errors = []; foreach ($array as $group) { if (!$this->clean($group)) { @@ -270,7 +270,7 @@ public function purge() return false; } - Factory::getApplication()->triggerEvent('onAfterPurge', array()); + Factory::getApplication()->triggerEvent('onAfterPurge', []); return true; } diff --git a/administrator/components/com_categories/layouts/joomla/form/field/categoryedit.php b/administrator/components/com_categories/layouts/joomla/form/field/categoryedit.php index a94ab5edcd4bb..79b7c2821cfa2 100644 --- a/administrator/components/com_categories/layouts/joomla/form/field/categoryedit.php +++ b/administrator/components/com_categories/layouts/joomla/form/field/categoryedit.php @@ -50,8 +50,8 @@ * @var string $customPrefix Optional prefix for new categories. */ -$html = array(); -$classes = array(); +$html = []; +$classes = []; $attr = ''; $attr2 = ''; diff --git a/administrator/components/com_categories/src/Controller/AjaxController.php b/administrator/components/com_categories/src/Controller/AjaxController.php index 93704465c63c9..a3afbb272c97d 100644 --- a/administrator/components/com_categories/src/Controller/AjaxController.php +++ b/administrator/components/com_categories/src/Controller/AjaxController.php @@ -71,7 +71,7 @@ public function fetchAssociations() $associations[$lang]->title = $categoryTable->title; } - $countContentLanguages = \count(LanguageHelper::getContentLanguages(array(0, 1), false)); + $countContentLanguages = \count(LanguageHelper::getContentLanguages([0, 1], false)); if (\count($associations) == 0) { $message = Text::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_NONE'); diff --git a/administrator/components/com_categories/src/Controller/CategoriesController.php b/administrator/components/com_categories/src/Controller/CategoriesController.php index ebed81342ec27..5c79b7d5ebb13 100644 --- a/administrator/components/com_categories/src/Controller/CategoriesController.php +++ b/administrator/components/com_categories/src/Controller/CategoriesController.php @@ -37,7 +37,7 @@ class CategoriesController extends AdminController * * @since 1.6 */ - public function getModel($name = 'Category', $prefix = 'Administrator', $config = array('ignore_request' => true)) + public function getModel($name = 'Category', $prefix = 'Administrator', $config = ['ignore_request' => true]) { return parent::getModel($name, $prefix, $config); } diff --git a/administrator/components/com_categories/src/Controller/CategoryController.php b/administrator/components/com_categories/src/Controller/CategoryController.php index ce8ac847deec0..f190d53f8f7c4 100644 --- a/administrator/components/com_categories/src/Controller/CategoryController.php +++ b/administrator/components/com_categories/src/Controller/CategoryController.php @@ -50,7 +50,7 @@ class CategoryController extends FormController * @since 1.6 * @throws \Exception */ - public function __construct($config = array(), MVCFactoryInterface $factory = null, CMSApplication $app = null, Input $input = null) + public function __construct($config = [], MVCFactoryInterface $factory = null, CMSApplication $app = null, Input $input = null) { parent::__construct($config, $factory, $app, $input); @@ -68,7 +68,7 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { $user = $this->app->getIdentity(); @@ -85,7 +85,7 @@ protected function allowAdd($data = array()) * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'parent_id') + protected function allowEdit($data = [], $key = 'parent_id') { $recordId = (int) isset($data[$key]) ? $data[$key] : 0; $user = $this->app->getIdentity(); @@ -230,7 +230,7 @@ protected function getRedirectToListAppend() * * @since 3.1 */ - protected function postSaveHook(BaseDatabaseModel $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { $item = $model->getItem(); diff --git a/administrator/components/com_categories/src/Controller/DisplayController.php b/administrator/components/com_categories/src/Controller/DisplayController.php index 12791d94996cb..8481ded0815ac 100644 --- a/administrator/components/com_categories/src/Controller/DisplayController.php +++ b/administrator/components/com_categories/src/Controller/DisplayController.php @@ -54,7 +54,7 @@ class DisplayController extends BaseController * * @since 3.0 */ - public function __construct($config = array(), MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); @@ -74,7 +74,7 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu * * @since 1.5 */ - public function display($cachable = false, $urlparams = array()) + public function display($cachable = false, $urlparams = []) { // Get the document object. $document = $this->app->getDocument(); @@ -100,7 +100,7 @@ public function display($cachable = false, $urlparams = array()) // Get and render the view. if ($view = $this->getView($vName, $vFormat)) { // Get the model for the view. - $model = $this->getModel($vName, 'Administrator', array('name' => $vName . '.' . substr($this->extension, 4))); + $model = $this->getModel($vName, 'Administrator', ['name' => $vName . '.' . substr($this->extension, 4)]); // Push the model into the view (as default). $view->setModel($model, true); diff --git a/administrator/components/com_categories/src/Field/CategoryeditField.php b/administrator/components/com_categories/src/Field/CategoryeditField.php index ae4e2d885bc8f..7600708471ff7 100644 --- a/administrator/components/com_categories/src/Field/CategoryeditField.php +++ b/administrator/components/com_categories/src/Field/CategoryeditField.php @@ -145,8 +145,8 @@ public function __set($name, $value) */ protected function getOptions() { - $options = array(); - $published = $this->element['published'] ? explode(',', (string) $this->element['published']) : array(0, 1); + $options = []; + $published = $this->element['published'] ? explode(',', (string) $this->element['published']) : [0, 1]; $name = (string) $this->element['name']; // Let's get the id for the current item, either category or content item. diff --git a/administrator/components/com_categories/src/Field/ComponentsCategoryField.php b/administrator/components/com_categories/src/Field/ComponentsCategoryField.php index 6877bd4970d32..e8f9f291c994f 100644 --- a/administrator/components/com_categories/src/Field/ComponentsCategoryField.php +++ b/administrator/components/com_categories/src/Field/ComponentsCategoryField.php @@ -45,7 +45,7 @@ protected function getOptions() { // Initialise variable. $db = $this->getDatabase(); - $options = array(); + $options = []; $query = $db->getQuery(true); $query->select('DISTINCT ' . $db->quoteName('extension')) diff --git a/administrator/components/com_categories/src/Field/Modal/CategoryField.php b/administrator/components/com_categories/src/Field/Modal/CategoryField.php index 05234673e7ddd..5540771a3b9c2 100644 --- a/administrator/components/com_categories/src/Field/Modal/CategoryField.php +++ b/administrator/components/com_categories/src/Field/Modal/CategoryField.php @@ -58,7 +58,7 @@ protected function getInput() $allowSelect = ((string) $this->element['select'] != 'false'); $allowPropagate = ((string) $this->element['propagate'] == 'true'); - $languages = LanguageHelper::getContentLanguages(array(0, 1), false); + $languages = LanguageHelper::getContentLanguages([0, 1], false); // Load language. Factory::getLanguage()->load('com_categories', JPATH_ADMINISTRATOR); @@ -80,7 +80,7 @@ protected function getInput() static $scriptSelect = null; if (is_null($scriptSelect)) { - $scriptSelect = array(); + $scriptSelect = []; } if (!isset($scriptSelect[$this->id])) { @@ -215,7 +215,7 @@ protected function getInput() $html .= HTMLHelper::_( 'bootstrap.renderModal', 'ModalSelect' . $modalId, - array( + [ 'title' => $modalTitle, 'url' => $urlSelect, 'height' => '400px', @@ -224,7 +224,7 @@ protected function getInput() 'modalWidth' => 80, 'footer' => '', - ) + ] ); } @@ -233,7 +233,7 @@ protected function getInput() $html .= HTMLHelper::_( 'bootstrap.renderModal', 'ModalNew' . $modalId, - array( + [ 'title' => Text::_('COM_CATEGORIES_NEW_CATEGORY'), 'backdrop' => 'static', 'keyboard' => false, @@ -252,7 +252,7 @@ protected function getInput() . '', - ) + ] ); } @@ -261,7 +261,7 @@ protected function getInput() $html .= HTMLHelper::_( 'bootstrap.renderModal', 'ModalEdit' . $modalId, - array( + [ 'title' => Text::_('COM_CATEGORIES_EDIT_CATEGORY'), 'backdrop' => 'static', 'keyboard' => false, @@ -280,7 +280,7 @@ protected function getInput() . '', - ) + ] ); } diff --git a/administrator/components/com_categories/src/Helper/CategoriesHelper.php b/administrator/components/com_categories/src/Helper/CategoriesHelper.php index cdbb9b878f7f9..c98e6f83ac837 100644 --- a/administrator/components/com_categories/src/Helper/CategoriesHelper.php +++ b/administrator/components/com_categories/src/Helper/CategoriesHelper.php @@ -37,7 +37,7 @@ class CategoriesHelper public static function getAssociations($pk, $extension = 'com_content') { $langAssociations = Associations::getAssociations($extension, '#__categories', 'com_categories.item', $pk, 'id', 'alias', ''); - $associations = array(); + $associations = []; $user = Factory::getUser(); $groups = $user->getAuthorisedViewLevels(); @@ -76,7 +76,7 @@ public static function validateCategoryId($catid, $extension) { $categoryTable = Table::getInstance('CategoryTable', '\\Joomla\\Component\\Categories\\Administrator\\Table\\'); - $data = array(); + $data = []; $data['id'] = $catid; $data['extension'] = $extension; diff --git a/administrator/components/com_categories/src/Helper/CategoryAssociationHelper.php b/administrator/components/com_categories/src/Helper/CategoryAssociationHelper.php index 914e5a47f7996..f4d1950b519a4 100644 --- a/administrator/components/com_categories/src/Helper/CategoryAssociationHelper.php +++ b/administrator/components/com_categories/src/Helper/CategoryAssociationHelper.php @@ -42,7 +42,7 @@ abstract class CategoryAssociationHelper */ public static function getCategoryAssociations($id = 0, $extension = 'com_content', $layout = null) { - $return = array(); + $return = []; if ($id) { $helperClassname = ucfirst(substr($extension, 4)) . 'HelperRoute'; @@ -50,7 +50,7 @@ public static function getCategoryAssociations($id = 0, $extension = 'com_conten $associations = CategoriesHelper::getAssociations($id, $extension); foreach ($associations as $tag => $item) { - if (class_exists($helperClassname) && \is_callable(array($helperClassname, 'getCategoryRoute'))) { + if (class_exists($helperClassname) && \is_callable([$helperClassname, 'getCategoryRoute'])) { $return[$tag] = $helperClassname::getCategoryRoute($item, $tag, $layout); } else { $link = 'index.php?option=' . $extension . '&view=category&id=' . $item; diff --git a/administrator/components/com_categories/src/Model/CategoriesModel.php b/administrator/components/com_categories/src/Model/CategoriesModel.php index 51e82700bfe30..e4db3214fd4b7 100644 --- a/administrator/components/com_categories/src/Model/CategoriesModel.php +++ b/administrator/components/com_categories/src/Model/CategoriesModel.php @@ -47,10 +47,10 @@ class CategoriesModel extends ListModel * * @since 1.6 */ - public function __construct($config = array(), MVCFactoryInterface $factory = null) + public function __construct($config = [], MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { - $config['filter_fields'] = array( + $config['filter_fields'] = [ 'id', 'a.id', 'title', 'a.title', 'alias', 'a.alias', @@ -66,7 +66,7 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu 'level', 'a.level', 'path', 'a.path', 'tag', - ); + ]; } if (Associations::isEnabled()) { diff --git a/administrator/components/com_categories/src/Model/CategoryModel.php b/administrator/components/com_categories/src/Model/CategoryModel.php index 6c257f11ae04a..1381b0b7fb6a0 100644 --- a/administrator/components/com_categories/src/Model/CategoryModel.php +++ b/administrator/components/com_categories/src/Model/CategoryModel.php @@ -87,7 +87,7 @@ class CategoryModel extends AdminModel * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = array(), MVCFactoryInterface $factory = null) + public function __construct($config = [], MVCFactoryInterface $factory = null) { $extension = Factory::getApplication()->input->get('extension', 'com_content'); $this->typeAlias = $extension . '.category'; @@ -154,7 +154,7 @@ protected function canEditState($record) * * @since 1.6 */ - public function getTable($type = 'Category', $prefix = 'Administrator', $config = array()) + public function getTable($type = 'Category', $prefix = 'Administrator', $config = []) { return parent::getTable($type, $prefix, $config); } @@ -228,7 +228,7 @@ public function getItem($pk = null) if ($result->id != null) { $result->associations = ArrayHelper::toInteger(CategoriesHelper::getAssociations($result->id, $result->extension)); } else { - $result->associations = array(); + $result->associations = []; } } @@ -245,7 +245,7 @@ public function getItem($pk = null) * * @since 1.6 */ - public function getForm($data = array(), $loadData = true) + public function getForm($data = [], $loadData = true) { $extension = $this->getState('category.extension'); $jinput = Factory::getApplication()->input; @@ -261,7 +261,7 @@ public function getForm($data = array(), $loadData = true) } // Get the form. - $form = $this->loadForm('com_categories.category' . $extension, 'category', array('control' => 'jform', 'load_data' => $loadData)); + $form = $this->loadForm('com_categories.category' . $extension, 'category', ['control' => 'jform', 'load_data' => $loadData]); if (empty($form)) { return false; @@ -325,7 +325,7 @@ protected function loadFormData() { // Check the session for previously entered form data. $app = Factory::getApplication(); - $data = $app->getUserState('com_categories.edit.' . $this->getName() . '.data', array()); + $data = $app->getUserState('com_categories.edit.' . $this->getName() . '.data', []); if (empty($data)) { $data = $this->getItem(); @@ -441,12 +441,12 @@ protected function preprocessForm(Form $form, $data, $group = 'content') \JLoader::register($cName, $path); - if (class_exists($cName) && \is_callable(array($cName, 'onPrepareForm'))) { + if (class_exists($cName) && \is_callable([$cName, 'onPrepareForm'])) { $lang->load($component, JPATH_BASE, null, false, false) || $lang->load($component, JPATH_BASE . '/components/' . $component, null, false, false) || $lang->load($component, JPATH_BASE, $lang->getDefault(), false, false) || $lang->load($component, JPATH_BASE . '/components/' . $component, $lang->getDefault(), false, false); - \call_user_func_array(array($cName, 'onPrepareForm'), array(&$form)); + \call_user_func_array([$cName, 'onPrepareForm'], [&$form]); // Check for an error. if ($form instanceof \Exception) { @@ -570,7 +570,7 @@ public function save($data) } // Trigger the before save event. - $result = Factory::getApplication()->triggerEvent($this->event_before_save, array($context, &$table, $isNew, $data)); + $result = Factory::getApplication()->triggerEvent($this->event_before_save, [$context, &$table, $isNew, $data]); if (\in_array(false, $result, true)) { $this->setError($table->getError()); @@ -589,7 +589,7 @@ public function save($data) if ($assoc) { // Adding self to the association - $associations = $data['associations'] ?? array(); + $associations = $data['associations'] ?? []; // Unset any invalid associations $associations = ArrayHelper::toInteger($associations); @@ -696,7 +696,7 @@ public function save($data) } // Trigger the after save event. - Factory::getApplication()->triggerEvent($this->event_after_save, array($context, &$table, $isNew, $data)); + Factory::getApplication()->triggerEvent($this->event_after_save, [$context, &$table, $isNew, $data]); // Rebuild the path for the category: if (!$table->rebuildPath($table->id)) { @@ -743,7 +743,7 @@ public function publish(&$pks, $value = 1) PluginHelper::importPlugin('content'); // Trigger the onCategoryChangeState event. - Factory::getApplication()->triggerEvent('onCategoryChangeState', array($extension, $pks, $value)); + Factory::getApplication()->triggerEvent('onCategoryChangeState', [$extension, $pks, $value]); return true; } @@ -815,7 +815,7 @@ public function saveorder($idArray = null, $lftArray = null) */ protected function batchFlipordering($value, $pks, $contexts) { - $successful = array(); + $successful = []; $db = $this->getDatabase(); $query = $db->getQuery(true); @@ -875,7 +875,7 @@ protected function batchCopy($value, $pks, $contexts) $db = $this->getDatabase(); $extension = Factory::getApplication()->input->get('extension', '', 'word'); - $newIds = array(); + $newIds = []; // Check that the parent exists if ($parentId) { @@ -922,7 +922,7 @@ protected function batchCopy($value, $pks, $contexts) } // We need to log the parent ID - $parents = array(); + $parents = []; // Calculate the emergency stop count as a precaution against a runaway loop bug $query = $db->getQuery(true) @@ -1121,7 +1121,7 @@ protected function batchMove($value, $pks, $contexts) } // We are going to store all the children and just move the category - $children = array(); + $children = []; // Parent exists so let's proceed foreach ($pks as $pk) { @@ -1249,12 +1249,12 @@ protected function generateNewTitle($parentId, $alias, $title) // Alter the title & alias $table = $this->getTable(); - while ($table->load(array('alias' => $alias, 'parent_id' => $parentId))) { + while ($table->load(['alias' => $alias, 'parent_id' => $parentId])) { $title = StringHelper::increment($title); $alias = StringHelper::increment($alias, 'dash'); } - return array($title, $alias); + return [$title, $alias]; } /** diff --git a/administrator/components/com_categories/src/Service/HTML/AdministratorService.php b/administrator/components/com_categories/src/Service/HTML/AdministratorService.php index b31b270f0ecbe..09fef6349644e 100644 --- a/administrator/components/com_categories/src/Service/HTML/AdministratorService.php +++ b/administrator/components/com_categories/src/Service/HTML/AdministratorService.php @@ -81,7 +81,7 @@ public function association($catid, $extension = 'com_content') } if ($items) { - $languages = LanguageHelper::getContentLanguages(array(0, 1)); + $languages = LanguageHelper::getContentLanguages([0, 1]); $content_languages = array_column($languages, 'lang_code'); foreach ($items as &$item) { diff --git a/administrator/components/com_categories/src/View/Category/HtmlView.php b/administrator/components/com_categories/src/View/Category/HtmlView.php index 7e0f3e566141c..84ec218af2036 100644 --- a/administrator/components/com_categories/src/View/Category/HtmlView.php +++ b/administrator/components/com_categories/src/View/Category/HtmlView.php @@ -98,7 +98,7 @@ public function display($tpl = null) } // Check if we have a content type for this alias - if (!empty(TagsHelper::getTypes('objectList', array($this->state->get('category.extension') . '.category'), true))) { + if (!empty(TagsHelper::getTypes('objectList', [$this->state->get('category.extension') . '.category'], true))) { $this->checkTags = true; } diff --git a/administrator/components/com_categories/tmpl/categories/default.php b/administrator/components/com_categories/tmpl/categories/default.php index 9a4ecb979c836..a78db17f79fb5 100644 --- a/administrator/components/com_categories/tmpl/categories/default.php +++ b/administrator/components/com_categories/tmpl/categories/default.php @@ -55,7 +55,7 @@
$this)); + echo LayoutHelper::render('joomla.searchtools.default', ['view' => $this]); ?> items)) : ?>
@@ -181,7 +181,7 @@ published, $i, 'categories.', $canChange); ?> - $item->level)); ?> + $item->level]); ?> checked_out) : ?> editor, $item->checked_out_time, 'categories.', $canCheckin); ?> @@ -288,10 +288,10 @@ Text::_('COM_CATEGORIES_BATCH_OPTIONS'), 'footer' => $this->loadTemplate('batch_footer'), - ), + ], $this->loadTemplate('batch_body') ); ?> diff --git a/administrator/components/com_categories/tmpl/categories/default_batch_body.php b/administrator/components/com_categories/tmpl/categories/default_batch_body.php index aa432d63f01c5..4dbc859a3324e 100644 --- a/administrator/components/com_categories/tmpl/categories/default_batch_body.php +++ b/administrator/components/com_categories/tmpl/categories/default_batch_body.php @@ -57,7 +57,7 @@
- +
diff --git a/administrator/components/com_categories/tmpl/categories/modal.php b/administrator/components/com_categories/tmpl/categories/modal.php index 819957f58ddc7..f04b1f9e64cfc 100644 --- a/administrator/components/com_categories/tmpl/categories/modal.php +++ b/administrator/components/com_categories/tmpl/categories/modal.php @@ -36,7 +36,7 @@ - $this)); ?> + $this]); ?> items)) : ?>
@@ -71,12 +71,12 @@ 'icon-trash', 0 => 'icon-times', 1 => 'icon-check', 2 => 'icon-folder', - ); + ]; ?> items as $i => $item) : ?> language && Multilanguage::isEnabled()) { @@ -99,7 +99,7 @@ - $item->level)); ?> + $item->level]); ?> escape($item->title); ?>
diff --git a/administrator/components/com_checkin/src/Controller/DisplayController.php b/administrator/components/com_checkin/src/Controller/DisplayController.php index 8f9204539a900..40b1f86f3c46e 100644 --- a/administrator/components/com_checkin/src/Controller/DisplayController.php +++ b/administrator/components/com_checkin/src/Controller/DisplayController.php @@ -41,7 +41,7 @@ class DisplayController extends BaseController * * @return static A \JControllerLegacy object to support chaining. */ - public function display($cachable = false, $urlparams = array()) + public function display($cachable = false, $urlparams = []) { return parent::display(); } @@ -56,7 +56,7 @@ public function checkin() // Check for request forgeries $this->checkToken(); - $ids = (array) $this->input->get('cid', array(), 'string'); + $ids = (array) $this->input->get('cid', [], 'string'); if (empty($ids)) { $this->app->enqueueMessage(Text::_('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST'), 'warning'); diff --git a/administrator/components/com_checkin/src/Model/CheckinModel.php b/administrator/components/com_checkin/src/Model/CheckinModel.php index 90eb55e5df220..ad415724ad659 100644 --- a/administrator/components/com_checkin/src/Model/CheckinModel.php +++ b/administrator/components/com_checkin/src/Model/CheckinModel.php @@ -41,13 +41,13 @@ class CheckinModel extends ListModel * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = array(), MVCFactoryInterface $factory = null) + public function __construct($config = [], MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { - $config['filter_fields'] = array( + $config['filter_fields'] = [ 'table', 'count', - ); + ]; } parent::__construct($config, $factory); @@ -80,7 +80,7 @@ protected function populateState($ordering = 'table', $direction = 'asc') * * @since 1.6 */ - public function checkin($ids = array()) + public function checkin($ids = []) { $db = $this->getDatabase(); @@ -128,7 +128,7 @@ public function checkin($ids = array()) if ($db->execute()) { $results = $results + $db->getAffectedRows(); - $app->triggerEvent('onAfterCheckin', array($tn)); + $app->triggerEvent('onAfterCheckin', [$tn]); } } @@ -166,7 +166,7 @@ public function getItems() $prefix = Factory::getApplication()->get('dbprefix'); // This array will hold table name as key and checked in item count as value. - $results = array(); + $results = []; foreach ($tables as $tn) { // Make sure we get the right tables based on prefix. diff --git a/administrator/components/com_checkin/tmpl/checkin/default.php b/administrator/components/com_checkin/tmpl/checkin/default.php index 1718632ffaa34..121fe41184d12 100644 --- a/administrator/components/com_checkin/tmpl/checkin/default.php +++ b/administrator/components/com_checkin/tmpl/checkin/default.php @@ -26,7 +26,7 @@
- $this)); ?> + $this]); ?> total > 0) : ?>
diff --git a/administrator/components/com_config/src/Controller/ApplicationController.php b/administrator/components/com_config/src/Controller/ApplicationController.php index ab8f223e075d8..3c6cad9aa1c81 100644 --- a/administrator/components/com_config/src/Controller/ApplicationController.php +++ b/administrator/components/com_config/src/Controller/ApplicationController.php @@ -42,7 +42,7 @@ class ApplicationController extends BaseController * * @since 3.0 */ - public function __construct($config = array(), MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); @@ -86,7 +86,7 @@ public function save() /** @var \Joomla\Component\Config\Administrator\Model\ApplicationModel $model */ $model = $this->getModel('Application', 'Administrator'); - $data = $this->input->post->get('jform', array(), 'array'); + $data = $this->input->post->get('jform', [], 'array'); // Complete data array if needed $oldData = $model->getData(); diff --git a/administrator/components/com_config/src/Controller/ComponentController.php b/administrator/components/com_config/src/Controller/ComponentController.php index dc9e8dae551e4..903df53806965 100644 --- a/administrator/components/com_config/src/Controller/ComponentController.php +++ b/administrator/components/com_config/src/Controller/ComponentController.php @@ -41,7 +41,7 @@ class ComponentController extends FormController * * @since 3.0 */ - public function __construct($config = array(), MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); diff --git a/administrator/components/com_config/src/Controller/DisplayController.php b/administrator/components/com_config/src/Controller/DisplayController.php index 6731ba3b20f33..b837e2a2acc7d 100644 --- a/administrator/components/com_config/src/Controller/DisplayController.php +++ b/administrator/components/com_config/src/Controller/DisplayController.php @@ -48,13 +48,13 @@ class DisplayController extends BaseController * @since 3.0 * @throws \Exception */ - public function display($cachable = false, $urlparams = array()) + public function display($cachable = false, $urlparams = []) { $component = $this->input->get('component', ''); // Make sure com_joomlaupdate and com_privacy can only be accessed by SuperUser if ( - in_array(strtolower($component), array('com_joomlaupdate', 'com_privacy')) + in_array(strtolower($component), ['com_joomlaupdate', 'com_privacy']) && !$this->app->getIdentity()->authorise('core.admin') ) { $this->setRedirect(Route::_('index.php'), Text::_('JERROR_ALERTNOAUTHOR'), 'error'); diff --git a/administrator/components/com_config/src/Controller/RequestController.php b/administrator/components/com_config/src/Controller/RequestController.php index 6322bda6d0eac..99a65d3a8410c 100644 --- a/administrator/components/com_config/src/Controller/RequestController.php +++ b/administrator/components/com_config/src/Controller/RequestController.php @@ -75,7 +75,7 @@ public function getJson() $this->userIsSuperAdmin = $user->authorise('core.admin'); // Required data - $requiredData = array( + $requiredData = [ 'sitename' => null, 'offline' => null, 'access' => null, @@ -89,7 +89,7 @@ public function getJson() 'error_reporting' => null, 'mailfrom' => null, 'fromname' => null - ); + ]; $data = array_intersect_key($data, $requiredData); diff --git a/administrator/components/com_config/src/Field/FiltersField.php b/administrator/components/com_config/src/Field/FiltersField.php index e0a5e30d7c48d..ad7ff7e60142c 100644 --- a/administrator/components/com_config/src/Field/FiltersField.php +++ b/administrator/components/com_config/src/Field/FiltersField.php @@ -55,7 +55,7 @@ protected function getInput() $groups = $this->getUserGroups(); // Build the form control. - $html = array(); + $html = []; // Open the table. $html[] = ''; @@ -83,7 +83,7 @@ protected function getInput() foreach ($groups as $group) { if (!isset($this->value[$group->value])) { - $this->value[$group->value] = array('filter_type' => 'BL', 'filter_tags' => '', 'filter_attributes' => ''); + $this->value[$group->value] = ['filter_type' => 'BL', 'filter_tags' => '', 'filter_attributes' => '']; } $group_filter = $this->value[$group->value]; @@ -93,7 +93,7 @@ protected function getInput() $html[] = ' '; $html[] = ' '; $html[] = ' 'icon-trash', 0 => 'icon-times', 1 => 'icon-check', 2 => 'icon-folder', - ); + ]; ?> items as $i => $item) : ?> language && $multilang) { diff --git a/administrator/components/com_content/src/Controller/AjaxController.php b/administrator/components/com_content/src/Controller/AjaxController.php index e4fcb3622b74b..c25348c6aaeac 100644 --- a/administrator/components/com_content/src/Controller/AjaxController.php +++ b/administrator/components/com_content/src/Controller/AjaxController.php @@ -68,7 +68,7 @@ public function fetchAssociations() $associations[$lang]->title = $contentTable->title; } - $countContentLanguages = count(LanguageHelper::getContentLanguages(array(0, 1), false)); + $countContentLanguages = count(LanguageHelper::getContentLanguages([0, 1], false)); if (count($associations) == 0) { $message = Text::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_NONE'); diff --git a/administrator/components/com_content/src/Controller/ArticleController.php b/administrator/components/com_content/src/Controller/ArticleController.php index fe0082cfc2ddd..ea7ca17803f2b 100644 --- a/administrator/components/com_content/src/Controller/ArticleController.php +++ b/administrator/components/com_content/src/Controller/ArticleController.php @@ -44,7 +44,7 @@ class ArticleController extends FormController * * @since 3.0 */ - public function __construct($config = array(), MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); @@ -67,7 +67,7 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu * * @since 4.0.0 */ - protected function postSaveHook(BaseDatabaseModel $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { if ($this->getTask() === 'save2menu') { $editState = []; @@ -83,10 +83,10 @@ protected function postSaveHook(BaseDatabaseModel $model, $validData = array()) $editState['type'] = $type; $editState['request']['id'] = $id; - $this->app->setUserState('com_menus.edit.item', array( + $this->app->setUserState('com_menus.edit.item', [ 'data' => $editState, 'type' => $type, - 'link' => $link)); + 'link' => $link]); $this->setRedirect(Route::_('index.php?option=com_menus&view=item&client_id=0&menutype=mainmenu&layout=edit', false)); } @@ -101,7 +101,7 @@ protected function postSaveHook(BaseDatabaseModel $model, $validData = array()) * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { $categoryId = ArrayHelper::getValue($data, 'catid', $this->input->getInt('filter_category_id'), 'int'); @@ -124,7 +124,7 @@ protected function allowAdd($data = array()) * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { $recordId = (int) isset($data[$key]) ? $data[$key] : 0; $user = $this->app->getIdentity(); @@ -170,7 +170,7 @@ public function batch($model = null) // Set the model /** @var \Joomla\Component\Content\Administrator\Model\ArticleModel $model */ - $model = $this->getModel('Article', 'Administrator', array()); + $model = $this->getModel('Article', 'Administrator', []); // Preset the redirect $this->setRedirect(Route::_('index.php?option=com_content&view=articles' . $this->getRedirectToListAppend(), false)); diff --git a/administrator/components/com_content/src/Controller/ArticlesController.php b/administrator/components/com_content/src/Controller/ArticlesController.php index 3c8628b0768e5..39f1df15dcceb 100644 --- a/administrator/components/com_content/src/Controller/ArticlesController.php +++ b/administrator/components/com_content/src/Controller/ArticlesController.php @@ -42,7 +42,7 @@ class ArticlesController extends AdminController * * @since 3.0 */ - public function __construct($config = array(), MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); @@ -68,8 +68,8 @@ public function featured() $this->checkToken(); $user = $this->app->getIdentity(); - $ids = (array) $this->input->get('cid', array(), 'int'); - $values = array('featured' => 1, 'unfeatured' => 0); + $ids = (array) $this->input->get('cid', [], 'int'); + $values = ['featured' => 1, 'unfeatured' => 0]; $task = $this->getTask(); $value = ArrayHelper::getValue($values, $task, 0, 'int'); $redirectUrl = 'index.php?option=com_content&view=' . $this->view_list . $this->getRedirectToListAppend(); @@ -129,7 +129,7 @@ public function featured() * * @since 1.6 */ - public function getModel($name = 'Article', $prefix = 'Administrator', $config = array('ignore_request' => true)) + public function getModel($name = 'Article', $prefix = 'Administrator', $config = ['ignore_request' => true]) { return parent::getModel($name, $prefix, $config); } diff --git a/administrator/components/com_content/src/Controller/DisplayController.php b/administrator/components/com_content/src/Controller/DisplayController.php index aa1e416bb3cf0..16da045d15e8b 100644 --- a/administrator/components/com_content/src/Controller/DisplayController.php +++ b/administrator/components/com_content/src/Controller/DisplayController.php @@ -43,7 +43,7 @@ class DisplayController extends BaseController * * @since 1.5 */ - public function display($cachable = false, $urlparams = array()) + public function display($cachable = false, $urlparams = []) { $view = $this->input->get('view', 'articles'); $layout = $this->input->get('layout', 'articles'); diff --git a/administrator/components/com_content/src/Controller/FeaturedController.php b/administrator/components/com_content/src/Controller/FeaturedController.php index b67b0a9c5767c..20f3d464ae2b3 100644 --- a/administrator/components/com_content/src/Controller/FeaturedController.php +++ b/administrator/components/com_content/src/Controller/FeaturedController.php @@ -36,7 +36,7 @@ public function delete() $this->checkToken(); $user = $this->app->getIdentity(); - $ids = (array) $this->input->get('cid', array(), 'int'); + $ids = (array) $this->input->get('cid', [], 'int'); // Access checks. foreach ($ids as $i => $id) { @@ -94,7 +94,7 @@ public function publish() * * @since 1.6 */ - public function getModel($name = 'Feature', $prefix = 'Administrator', $config = array('ignore_request' => true)) + public function getModel($name = 'Feature', $prefix = 'Administrator', $config = ['ignore_request' => true]) { return parent::getModel($name, $prefix, $config); } diff --git a/administrator/components/com_content/src/Event/Model/FeatureEvent.php b/administrator/components/com_content/src/Event/Model/FeatureEvent.php index 4b03ecb8ce37a..8c5d23fe87c3d 100644 --- a/administrator/components/com_content/src/Event/Model/FeatureEvent.php +++ b/administrator/components/com_content/src/Event/Model/FeatureEvent.php @@ -33,7 +33,7 @@ class FeatureEvent extends AbstractImmutableEvent * * @since 4.0.0 */ - public function __construct($name, array $arguments = array()) + public function __construct($name, array $arguments = []) { if (!isset($arguments['extension'])) { throw new BadMethodCallException("Argument 'extension' of event $this->name is required but has not been provided"); diff --git a/administrator/components/com_content/src/Extension/ContentComponent.php b/administrator/components/com_content/src/Extension/ContentComponent.php index 7b71986af3041..7da0a914f570b 100644 --- a/administrator/components/com_content/src/Extension/ContentComponent.php +++ b/administrator/components/com_content/src/Extension/ContentComponent.php @@ -173,10 +173,10 @@ public function getContexts(): array { Factory::getLanguage()->load('com_content', JPATH_ADMINISTRATOR); - $contexts = array( + $contexts = [ 'com_content.article' => Text::_('COM_CONTENT'), 'com_content.categories' => Text::_('JCATEGORY') - ); + ]; return $contexts; } @@ -192,9 +192,9 @@ public function getWorkflowContexts(): array { Factory::getLanguage()->load('com_content', JPATH_ADMINISTRATOR); - $contexts = array( + $contexts = [ 'com_content.article' => Text::_('COM_CONTENT') - ); + ]; return $contexts; } @@ -298,14 +298,14 @@ public function filterTransitions(array $transitions, int $pk): array */ public function countItems(array $items, string $section) { - $config = (object) array( + $config = (object) [ 'related_tbl' => 'content', 'state_col' => 'state', 'group_col' => 'catid', 'relation_type' => 'category_or_group', 'uses_workflows' => true, 'workflows_component' => 'com_content' - ); + ]; LibraryContentHelper::countRelations($items, $config); } @@ -326,13 +326,13 @@ public function countTagItems(array $items, string $extension) $parts = explode('.', $extension); $section = count($parts) > 1 ? $parts[1] : null; - $config = (object) array( + $config = (object) [ 'related_tbl' => ($section === 'category' ? 'categories' : 'content'), 'state_col' => ($section === 'category' ? 'published' : 'state'), 'group_col' => 'tag_id', 'extension' => $extension, 'relation_type' => 'tag_assigments', - ); + ]; LibraryContentHelper::countRelations($items, $config); } diff --git a/administrator/components/com_content/src/Field/Modal/ArticleField.php b/administrator/components/com_content/src/Field/Modal/ArticleField.php index a497aecd62789..e0ea6b0750c99 100644 --- a/administrator/components/com_content/src/Field/Modal/ArticleField.php +++ b/administrator/components/com_content/src/Field/Modal/ArticleField.php @@ -52,7 +52,7 @@ protected function getInput() $allowSelect = ((string) $this->element['select'] != 'false'); $allowPropagate = ((string) $this->element['propagate'] == 'true'); - $languages = LanguageHelper::getContentLanguages(array(0, 1), false); + $languages = LanguageHelper::getContentLanguages([0, 1], false); // Load language Factory::getLanguage()->load('com_content', JPATH_ADMINISTRATOR); @@ -74,7 +74,7 @@ protected function getInput() static $scriptSelect = null; if (is_null($scriptSelect)) { - $scriptSelect = array(); + $scriptSelect = []; } if (!isset($scriptSelect[$this->id])) { @@ -211,7 +211,7 @@ protected function getInput() $html .= HTMLHelper::_( 'bootstrap.renderModal', 'ModalSelect' . $modalId, - array( + [ 'title' => $modalTitle, 'url' => $urlSelect, 'height' => '400px', @@ -220,7 +220,7 @@ protected function getInput() 'modalWidth' => 80, 'footer' => '', - ) + ] ); } @@ -229,7 +229,7 @@ protected function getInput() $html .= HTMLHelper::_( 'bootstrap.renderModal', 'ModalNew' . $modalId, - array( + [ 'title' => Text::_('COM_CONTENT_NEW_ARTICLE'), 'backdrop' => 'static', 'keyboard' => false, @@ -248,7 +248,7 @@ protected function getInput() . '', - ) + ] ); } @@ -257,7 +257,7 @@ protected function getInput() $html .= HTMLHelper::_( 'bootstrap.renderModal', 'ModalEdit' . $modalId, - array( + [ 'title' => Text::_('COM_CONTENT_EDIT_ARTICLE'), 'backdrop' => 'static', 'keyboard' => false, @@ -276,7 +276,7 @@ protected function getInput() . '', - ) + ] ); } diff --git a/administrator/components/com_content/src/Helper/AssociationsHelper.php b/administrator/components/com_content/src/Helper/AssociationsHelper.php index ab7670a4e597f..715571998acce 100644 --- a/administrator/components/com_content/src/Helper/AssociationsHelper.php +++ b/administrator/components/com_content/src/Helper/AssociationsHelper.php @@ -42,7 +42,7 @@ class AssociationsHelper extends AssociationExtensionHelper * * @since 3.7.0 */ - protected $itemTypes = array('article', 'category'); + protected $itemTypes = ['article', 'category']; /** * Has the extension association support @@ -153,8 +153,8 @@ public function getItem($typeName, $id) public function getType($typeName = '') { $fields = $this->getFieldsTemplate(); - $tables = array(); - $joins = array(); + $tables = []; + $joins = []; $support = $this->getSupportTemplate(); $title = ''; @@ -167,9 +167,9 @@ public function getType($typeName = '') $support['category'] = true; $support['save2copy'] = true; - $tables = array( + $tables = [ 'a' => '#__content' - ); + ]; $title = 'article'; break; @@ -186,21 +186,21 @@ public function getType($typeName = '') $support['checkout'] = true; $support['level'] = true; - $tables = array( + $tables = [ 'a' => '#__categories' - ); + ]; $title = 'category'; break; } } - return array( + return [ 'fields' => $fields, 'support' => $support, 'tables' => $tables, 'joins' => $joins, 'title' => $title - ); + ]; } } diff --git a/administrator/components/com_content/src/Model/ArticleModel.php b/administrator/components/com_content/src/Model/ArticleModel.php index e7e47fb6c109a..1bfa02141a6ed 100644 --- a/administrator/components/com_content/src/Model/ArticleModel.php +++ b/administrator/components/com_content/src/Model/ArticleModel.php @@ -103,7 +103,7 @@ class ArticleModel extends AdminModel implements WorkflowModelInterface * @since 1.6 * @throws \Exception */ - public function __construct($config = array(), MVCFactoryInterface $factory = null, FormFactoryInterface $formFactory = null) + public function __construct($config = [], MVCFactoryInterface $factory = null, FormFactoryInterface $formFactory = null) { $config['events_map'] = $config['events_map'] ?? []; @@ -171,17 +171,17 @@ protected function cleanupPostBatchCopy(TableInterface $table, $newId, $oldId) $oldItem->load($oldId); $fields = FieldsHelper::getFields('com_content.article', $oldItem, true); - $fieldsData = array(); + $fieldsData = []; if (!empty($fields)) { - $fieldsData['com_fields'] = array(); + $fieldsData['com_fields'] = []; foreach ($fields as $field) { $fieldsData['com_fields'][$field->name] = $field->rawvalue; } } - Factory::getApplication()->triggerEvent('onContentAfterSave', array('com_content.article', &$this->table, false, $fieldsData)); + Factory::getApplication()->triggerEvent('onContentAfterSave', ['com_content.article', &$this->table, false, $fieldsData]); } /** @@ -238,10 +238,10 @@ protected function batchMove($value, $pks, $contexts) $fields = FieldsHelper::getFields('com_content.article', $this->table, true); - $fieldsData = array(); + $fieldsData = []; if (!empty($fields)) { - $fieldsData['com_fields'] = array(); + $fieldsData['com_fields'] = []; foreach ($fields as $field) { $fieldsData['com_fields'][$field->name] = $field->rawvalue; @@ -271,7 +271,7 @@ protected function batchMove($value, $pks, $contexts) } // Run event for moved article - Factory::getApplication()->triggerEvent('onContentAfterSave', array('com_content.article', &$this->table, false, $fieldsData)); + Factory::getApplication()->triggerEvent('onContentAfterSave', ['com_content.article', &$this->table, false, $fieldsData]); } // Clean the cache @@ -434,7 +434,7 @@ public function getItem($pk = null) $assoc = Associations::isEnabled(); if ($assoc) { - $item->associations = array(); + $item->associations = []; if ($item->id != null) { $associations = Associations::getAssociations('com_content', '#__content', 'com_content.item', $item->id); @@ -458,12 +458,12 @@ public function getItem($pk = null) * * @since 1.6 */ - public function getForm($data = array(), $loadData = true) + public function getForm($data = [], $loadData = true) { $app = Factory::getApplication(); // Get the form. - $form = $this->loadForm('com_content.article', 'article', array('control' => 'jform', 'load_data' => $loadData)); + $form = $this->loadForm('com_content.article', 'article', ['control' => 'jform', 'load_data' => $loadData]); if (empty($form)) { return false; @@ -571,7 +571,7 @@ protected function loadFormData() { // Check the session for previously entered form data. $app = Factory::getApplication(); - $data = $app->getUserState('com_content.edit.article.data', array()); + $data = $app->getUserState('com_content.edit.article.data', []); if (empty($data)) { $data = $this->getItem(); @@ -704,7 +704,7 @@ public function save($data) } if (isset($data['urls']) && is_array($data['urls'])) { - $check = $input->post->get('jform', array(), 'array'); + $check = $input->post->get('jform', [], 'array'); foreach ($data['urls'] as $i => $url) { if ($url != false && ($i == 'urla' || $i == 'urlb' || $i == 'urlc')) { @@ -753,7 +753,7 @@ public function save($data) } // Automatic handling of alias for empty fields - if (in_array($input->get('task'), array('apply', 'save', 'save2new')) && (!isset($data['id']) || (int) $data['id'] == 0)) { + if (in_array($input->get('task'), ['apply', 'save', 'save2new']) && (!isset($data['id']) || (int) $data['id'] == 0)) { if ($data['alias'] == null) { if ($app->get('unicodeslugs') == 1) { $data['alias'] = OutputFilter::stringUrlUnicodeSlug($data['title']); @@ -763,7 +763,7 @@ public function save($data) $table = $this->getTable(); - if ($table->load(array('alias' => $data['alias'], 'catid' => $data['catid']))) { + if ($table->load(['alias' => $data['alias'], 'catid' => $data['catid']])) { $msg = Text::_('COM_CONTENT_SAVE_WARNING'); } diff --git a/administrator/components/com_content/src/Model/ArticlesModel.php b/administrator/components/com_content/src/Model/ArticlesModel.php index 280d4e847909b..0b9878947dbe3 100644 --- a/administrator/components/com_content/src/Model/ArticlesModel.php +++ b/administrator/components/com_content/src/Model/ArticlesModel.php @@ -41,10 +41,10 @@ class ArticlesModel extends ListModel * @since 1.6 * @see \Joomla\CMS\MVC\Controller\BaseController */ - public function __construct($config = array()) + public function __construct($config = []) { if (empty($config['filter_fields'])) { - $config['filter_fields'] = array( + $config['filter_fields'] = [ 'id', 'a.id', 'title', 'a.title', 'alias', 'a.alias', @@ -73,7 +73,7 @@ public function __construct($config = array()) 'rating_count', 'rating', 'stage', 'wa.stage_id', 'ws.title' - ); + ]; if (Associations::isEnabled()) { $config['filter_fields'][] = 'association'; @@ -93,7 +93,7 @@ public function __construct($config = array()) * * @since 3.2 */ - public function getFilterForm($data = array(), $loadData = true) + public function getFilterForm($data = [], $loadData = true) { $form = parent::getFilterForm($data, $loadData); @@ -383,18 +383,18 @@ protected function getListQuery() } // Filter by categories and by level - $categoryId = $this->getState('filter.category_id', array()); + $categoryId = $this->getState('filter.category_id', []); $level = (int) $this->getState('filter.level'); if (!is_array($categoryId)) { - $categoryId = $categoryId ? array($categoryId) : array(); + $categoryId = $categoryId ? [$categoryId] : []; } // Case: Using both categories filter and by level filter if (count($categoryId)) { $categoryId = ArrayHelper::toInteger($categoryId); $categoryTable = Table::getInstance('Category', 'JTable'); - $subCatItemsWhere = array(); + $subCatItemsWhere = []; foreach ($categoryId as $key => $filter_catid) { $categoryTable->load($filter_catid); @@ -569,7 +569,7 @@ public function getTransitions() $workflow_ids = ArrayHelper::toInteger($workflow_ids); $workflow_ids = array_values(array_unique(array_filter($workflow_ids))); - $this->cache[$store] = array(); + $this->cache[$store] = []; try { if (count($stage_ids) || count($workflow_ids)) { diff --git a/administrator/components/com_content/src/Model/FeatureModel.php b/administrator/components/com_content/src/Model/FeatureModel.php index 250b5e28079bd..a47894f1606cf 100644 --- a/administrator/components/com_content/src/Model/FeatureModel.php +++ b/administrator/components/com_content/src/Model/FeatureModel.php @@ -32,7 +32,7 @@ class FeatureModel extends ArticleModel * * @since 1.6 */ - public function getTable($type = 'Featured', $prefix = 'Administrator', $config = array()) + public function getTable($type = 'Featured', $prefix = 'Administrator', $config = []) { return parent::getTable($type, $prefix, $config); } diff --git a/administrator/components/com_content/src/Model/FeaturedModel.php b/administrator/components/com_content/src/Model/FeaturedModel.php index cfa43d64fb26e..8cfece263ac59 100644 --- a/administrator/components/com_content/src/Model/FeaturedModel.php +++ b/administrator/components/com_content/src/Model/FeaturedModel.php @@ -29,10 +29,10 @@ class FeaturedModel extends ArticlesModel * @see \Joomla\CMS\MVC\Controller\BaseController * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { if (empty($config['filter_fields'])) { - $config['filter_fields'] = array( + $config['filter_fields'] = [ 'id', 'a.id', 'title', 'a.title', 'alias', 'a.alias', @@ -59,7 +59,7 @@ public function __construct($config = array()) 'tag', 'rating_count', 'rating', 'ws.title', - ); + ]; } parent::__construct($config); diff --git a/administrator/components/com_content/src/Service/HTML/AdministratorService.php b/administrator/components/com_content/src/Service/HTML/AdministratorService.php index a432a1df01cf0..5616c632a173a 100644 --- a/administrator/components/com_content/src/Service/HTML/AdministratorService.php +++ b/administrator/components/com_content/src/Service/HTML/AdministratorService.php @@ -78,7 +78,7 @@ public function association($articleid) } if ($items) { - $languages = LanguageHelper::getContentLanguages(array(0, 1)); + $languages = LanguageHelper::getContentLanguages([0, 1]); $content_languages = array_column($languages, 'lang_code'); foreach ($items as &$item) { diff --git a/administrator/components/com_content/src/Service/HTML/Icon.php b/administrator/components/com_content/src/Service/HTML/Icon.php index e39da57d89300..87aa71182ec73 100644 --- a/administrator/components/com_content/src/Service/HTML/Icon.php +++ b/administrator/components/com_content/src/Service/HTML/Icon.php @@ -44,7 +44,7 @@ class Icon * * @since 4.0.0 */ - public function create($category, $params, $attribs = array(), $legacy = false) + public function create($category, $params, $attribs = [], $legacy = false) { $uri = Uri::getInstance(); @@ -85,7 +85,7 @@ public function create($category, $params, $attribs = array(), $legacy = false) * * @since 4.0.0 */ - public function edit($article, $params, $attribs = array(), $legacy = false) + public function edit($article, $params, $attribs = [], $legacy = false) { $user = Factory::getUser(); $uri = Uri::getInstance(); @@ -112,7 +112,7 @@ public function edit($article, $params, $attribs = array(), $legacy = false) $tooltip = Text::sprintf('COM_CONTENT_CHECKED_OUT_BY', $checkoutUser->name) . '
' . $date; - $text = LayoutHelper::render('joomla.content.icons.edit_lock', array('article' => $article, 'tooltip' => $tooltip, 'legacy' => $legacy)); + $text = LayoutHelper::render('joomla.content.icons.edit_lock', ['article' => $article, 'tooltip' => $tooltip, 'legacy' => $legacy]); $attribs['aria-describedby'] = 'editarticle-' . (int) $article->id; $output = HTMLHelper::_('link', '#', $text, $attribs); @@ -129,7 +129,7 @@ public function edit($article, $params, $attribs = array(), $legacy = false) $tooltip = Text::_('COM_CONTENT_EDIT_PUBLISHED_ARTICLE'); } - $text = LayoutHelper::render('joomla.content.icons.edit', array('article' => $article, 'tooltip' => $tooltip, 'legacy' => $legacy)); + $text = LayoutHelper::render('joomla.content.icons.edit', ['article' => $article, 'tooltip' => $tooltip, 'legacy' => $legacy]); $attribs['aria-describedby'] = 'editarticle-' . (int) $article->id; $output = HTMLHelper::_('link', Route::_($url), $text, $attribs); @@ -149,7 +149,7 @@ public function edit($article, $params, $attribs = array(), $legacy = false) */ public function print_screen($params, $legacy = false) { - $text = LayoutHelper::render('joomla.content.icons.print_screen', array('params' => $params, 'legacy' => $legacy)); + $text = LayoutHelper::render('joomla.content.icons.print_screen', ['params' => $params, 'legacy' => $legacy]); return ''; } diff --git a/administrator/components/com_content/tmpl/article/edit.php b/administrator/components/com_content/tmpl/article/edit.php index 969455f185a16..96eecc6b0711a 100644 --- a/administrator/components/com_content/tmpl/article/edit.php +++ b/administrator/components/com_content/tmpl/article/edit.php @@ -27,11 +27,11 @@ ->useScript('form.validate') ->useScript('com_contenthistory.admin-history-versions'); -$this->configFieldsets = array('editorConfig'); -$this->hiddenFieldsets = array('basic-limited'); +$this->configFieldsets = ['editorConfig']; +$this->hiddenFieldsets = ['basic-limited']; $fieldsetsInImages = ['image-intro', 'image-full']; $fieldsetsInLinks = ['linka', 'linkb', 'linkc']; -$this->ignore_fieldsets = array_merge(array('jmetadata', 'item_associations'), $fieldsetsInImages, $fieldsetsInLinks); +$this->ignore_fieldsets = array_merge(['jmetadata', 'item_associations'], $fieldsetsInImages, $fieldsetsInLinks); $this->useCoreUI = true; // Create shortcut to parameters. diff --git a/administrator/components/com_content/tmpl/articles/default.php b/administrator/components/com_content/tmpl/articles/default.php index 3e260a1d2ee54..ced3aba5a0635 100644 --- a/administrator/components/com_content/tmpl/articles/default.php +++ b/administrator/components/com_content/tmpl/articles/default.php @@ -74,7 +74,7 @@
$this)); + echo LayoutHelper::render('joomla.searchtools.default', ['view' => $this]); ?> items)) : ?>
@@ -378,10 +378,10 @@ Text::_('COM_CONTENT_BATCH_OPTIONS'), 'footer' => $this->loadTemplate('batch_footer'), - ), + ], $this->loadTemplate('batch_body') ); ?> diff --git a/administrator/components/com_content/tmpl/articles/modal.php b/administrator/components/com_content/tmpl/articles/modal.php index d99d647c4641c..e45f3ef89ba0a 100644 --- a/administrator/components/com_content/tmpl/articles/modal.php +++ b/administrator/components/com_content/tmpl/articles/modal.php @@ -40,7 +40,7 @@ if (!empty($editor)) { // This view is used also in com_menus. Load the xtd script only if the editor is set! - $this->document->addScriptOptions('xtd-articles', array('editor' => $editor)); + $this->document->addScriptOptions('xtd-articles', ['editor' => $editor]); $onclick = "jSelectArticle"; } ?> @@ -48,7 +48,7 @@ - $this)); ?> + $this]); ?> items)) : ?>
@@ -88,11 +88,11 @@
'icon-trash', 0 => 'icon-times', 1 => 'icon-check', - ); + ]; ?> items as $i => $item) : ?> language && $multilang) { diff --git a/administrator/components/com_content/tmpl/featured/default.php b/administrator/components/com_content/tmpl/featured/default.php index 8aff2eb661e2c..4f6ce814814d8 100644 --- a/administrator/components/com_content/tmpl/featured/default.php +++ b/administrator/components/com_content/tmpl/featured/default.php @@ -76,7 +76,7 @@
$this)); + echo LayoutHelper::render('joomla.searchtools.default', ['view' => $this]); ?> items)) : ?>
@@ -375,10 +375,10 @@ Text::_('JTOOLBAR_CHANGE_STATUS'), 'footer' => $this->loadTemplate('stage_footer'), - ), + ], $this->loadTemplate('stage_body') ); ?> diff --git a/administrator/components/com_contenthistory/src/Controller/HistoryController.php b/administrator/components/com_contenthistory/src/Controller/HistoryController.php index 3044f40f5011c..8b924833a3839 100644 --- a/administrator/components/com_contenthistory/src/Controller/HistoryController.php +++ b/administrator/components/com_contenthistory/src/Controller/HistoryController.php @@ -37,7 +37,7 @@ class HistoryController extends AdminController * * @since 3.2 */ - public function getModel($name = 'History', $prefix = 'Administrator', $config = array('ignore_request' => true)) + public function getModel($name = 'History', $prefix = 'Administrator', $config = ['ignore_request' => true]) { return parent::getModel($name, $prefix, $config); } @@ -54,7 +54,7 @@ public function keep() $this->checkToken(); // Get items to toggle keep forever from the request. - $cid = (array) $this->input->get('cid', array(), 'int'); + $cid = (array) $this->input->get('cid', [], 'int'); // Remove zero values resulting from input filter $cid = array_filter($cid); diff --git a/administrator/components/com_contenthistory/src/Controller/PreviewController.php b/administrator/components/com_contenthistory/src/Controller/PreviewController.php index dfd3cdb095ec3..d966244884656 100644 --- a/administrator/components/com_contenthistory/src/Controller/PreviewController.php +++ b/administrator/components/com_contenthistory/src/Controller/PreviewController.php @@ -34,7 +34,7 @@ class PreviewController extends BaseController * * @since 3.2 */ - public function getModel($name = 'Preview', $prefix = 'Administrator', $config = array('ignore_request' => true)) + public function getModel($name = 'Preview', $prefix = 'Administrator', $config = ['ignore_request' => true]) { return parent::getModel($name, $prefix, $config); } diff --git a/administrator/components/com_contenthistory/src/Helper/ContenthistoryHelper.php b/administrator/components/com_contenthistory/src/Helper/ContenthistoryHelper.php index 4d32cd60fe4e6..253513ec12274 100644 --- a/administrator/components/com_contenthistory/src/Helper/ContenthistoryHelper.php +++ b/administrator/components/com_contenthistory/src/Helper/ContenthistoryHelper.php @@ -42,7 +42,7 @@ class ContenthistoryHelper */ public static function createObjectArray($object) { - $result = array(); + $result = []; if ($object === null) { return $result; @@ -102,8 +102,8 @@ public static function decodeFields($jsonString) */ public static function getFormValues($object, ContentType $typesTable) { - $labels = array(); - $values = array(); + $labels = []; + $values = []; $expandedObjectArray = static::createObjectArray($object); static::loadLanguageFiles($typesTable->type_alias); @@ -323,7 +323,7 @@ public static function prepareData(ContentHistory $table) $typesTable = Table::getInstance('ContentType', 'Joomla\\CMS\\Table\\'); $typeAlias = explode('.', $table->item_id); array_pop($typeAlias); - $typesTable->load(array('type_alias' => implode('.', $typeAlias))); + $typesTable->load(['type_alias' => implode('.', $typeAlias)]); $formValues = static::getFormValues($object, $typesTable); $object = static::mergeLabels($object, $formValues); $object = static::hideFields($object, $typesTable); diff --git a/administrator/components/com_contenthistory/src/Model/CompareModel.php b/administrator/components/com_contenthistory/src/Model/CompareModel.php index b95a7549a8c26..d624100b6abb2 100644 --- a/administrator/components/com_contenthistory/src/Model/CompareModel.php +++ b/administrator/components/com_contenthistory/src/Model/CompareModel.php @@ -59,7 +59,7 @@ public function getItems() return false; } - $result = array(); + $result = []; if (!$table1->load($id1) || !$table2->load($id2)) { $this->setError(Text::_('COM_CONTENTHISTORY_ERROR_VERSION_NOT_FOUND')); @@ -75,7 +75,7 @@ public function getItems() array_pop($typeAlias); $typeAlias = implode('.', $typeAlias); - if (!$contentTypeTable->load(array('type_alias' => $typeAlias))) { + if (!$contentTypeTable->load(['type_alias' => $typeAlias])) { $this->setError(Text::_('COM_CONTENTHISTORY_ERROR_FAILED_LOADING_CONTENT_TYPE')); // Assume a failure to load the content type means broken data, abort mission @@ -91,7 +91,7 @@ public function getItems() $nullDate = $this->getDatabase()->getNullDate(); - foreach (array($table1, $table2) as $table) { + foreach ([$table1, $table2] as $table) { $object = new \stdClass(); $object->data = ContenthistoryHelper::prepareData($table); $object->version_note = $table->version_note; @@ -99,7 +99,7 @@ public function getItems() // Let's use custom calendars when present $object->save_date = HTMLHelper::_('date', $table->save_date, Text::_('DATE_FORMAT_LC6')); - $dateProperties = array ( + $dateProperties = [ 'modified_time', 'created_time', 'modified', @@ -107,7 +107,7 @@ public function getItems() 'checked_out_time', 'publish_up', 'publish_down', - ); + ]; foreach ($dateProperties as $dateProperty) { if ( @@ -140,7 +140,7 @@ public function getItems() * * @since 3.2 */ - public function getTable($type = 'Contenthistory', $prefix = 'Joomla\\CMS\\Table\\', $config = array()) + public function getTable($type = 'Contenthistory', $prefix = 'Joomla\\CMS\\Table\\', $config = []) { return Table::getInstance($type, $prefix, $config); } @@ -174,7 +174,7 @@ protected function canEdit($record) $typeAlias = explode('.', $record->item_id); $id = array_pop($typeAlias); $typeAlias = implode('.', $typeAlias); - $contentTypeTable->load(array('type_alias' => $typeAlias)); + $contentTypeTable->load(['type_alias' => $typeAlias]); $typeEditables = (array) Factory::getApplication()->getUserState(str_replace('.', '.edit.', $contentTypeTable->type_alias) . '.id'); $result = in_array((int) $id, $typeEditables); } diff --git a/administrator/components/com_contenthistory/src/Model/HistoryModel.php b/administrator/components/com_contenthistory/src/Model/HistoryModel.php index eef600e1b869d..ba00bb7c529f4 100644 --- a/administrator/components/com_contenthistory/src/Model/HistoryModel.php +++ b/administrator/components/com_contenthistory/src/Model/HistoryModel.php @@ -43,10 +43,10 @@ class HistoryModel extends ListModel * @see \Joomla\CMS\MVC\Model\BaseDatabaseModel * @since 3.2 */ - public function __construct($config = array(), MVCFactoryInterface $factory = null) + public function __construct($config = [], MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { - $config['filter_fields'] = array( + $config['filter_fields'] = [ 'version_id', 'h.version_id', 'version_note', @@ -55,7 +55,7 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu 'h.save_date', 'editor_user_id', 'h.editor_user_id', - ); + ]; } parent::__construct($config, $factory); @@ -93,7 +93,7 @@ protected function canEdit($record) $typeAlias = explode('.', $record->item_id); $id = array_pop($typeAlias); $typeAlias = implode('.', $typeAlias); - $contentTypeTable->load(array('type_alias' => $typeAlias)); + $contentTypeTable->load(['type_alias' => $typeAlias]); $typeEditables = (array) Factory::getApplication()->getUserState(str_replace('.', '.edit.', $contentTypeTable->type_alias) . '.id'); $result = in_array((int) $id, $typeEditables); @@ -221,7 +221,7 @@ public function getItems() * * @since 3.2 */ - public function getTable($type = 'ContentHistory', $prefix = 'Joomla\\CMS\\Table\\', $config = array()) + public function getTable($type = 'ContentHistory', $prefix = 'Joomla\\CMS\\Table\\', $config = []) { return Table::getInstance($type, $prefix, $config); } diff --git a/administrator/components/com_contenthistory/src/Model/PreviewModel.php b/administrator/components/com_contenthistory/src/Model/PreviewModel.php index 4cb7993620e24..f6276af561589 100644 --- a/administrator/components/com_contenthistory/src/Model/PreviewModel.php +++ b/administrator/components/com_contenthistory/src/Model/PreviewModel.php @@ -66,7 +66,7 @@ public function getItem($pk = null) // Let's use custom calendars when present $result->save_date = HTMLHelper::_('date', $table->save_date, Text::_('DATE_FORMAT_LC6')); - $dateProperties = array ( + $dateProperties = [ 'modified_time', 'created_time', 'modified', @@ -74,7 +74,7 @@ public function getItem($pk = null) 'checked_out_time', 'publish_up', 'publish_down', - ); + ]; $nullDate = $this->getDatabase()->getNullDate(); @@ -106,7 +106,7 @@ public function getItem($pk = null) * * @since 3.2 */ - public function getTable($type = 'ContentHistory', $prefix = 'Joomla\\CMS\\Table\\', $config = array()) + public function getTable($type = 'ContentHistory', $prefix = 'Joomla\\CMS\\Table\\', $config = []) { return Table::getInstance($type, $prefix, $config); } diff --git a/administrator/components/com_cpanel/src/Controller/DisplayController.php b/administrator/components/com_cpanel/src/Controller/DisplayController.php index 1671a942ebe0a..8cbdda47ef726 100644 --- a/administrator/components/com_cpanel/src/Controller/DisplayController.php +++ b/administrator/components/com_cpanel/src/Controller/DisplayController.php @@ -45,7 +45,7 @@ class DisplayController extends BaseController * * @since 3.0 */ - public function display($cachable = false, $urlparams = array()) + public function display($cachable = false, $urlparams = []) { /* * Set the template - this will display cpanel.php diff --git a/administrator/components/com_cpanel/tmpl/cpanel/default.php b/administrator/components/com_cpanel/tmpl/cpanel/default.php index 20d1219de7c63..d3601723f5c18 100644 --- a/administrator/components/com_cpanel/tmpl/cpanel/default.php +++ b/administrator/components/com_cpanel/tmpl/cpanel/default.php @@ -36,7 +36,7 @@ echo HTMLHelper::_( 'bootstrap.renderModal', 'moduleDashboardAddModal', - array( + [ 'title' => Text::_('COM_CPANEL_ADD_MODULE_MODAL_TITLE'), 'backdrop' => 'static', 'url' => Route::_('index.php?option=com_cpanel&task=addModule&function=jSelectModuleType&position=' . $this->escape($this->position)), @@ -46,7 +46,7 @@ . Text::_('JLIB_HTML_BEHAVIOR_CLOSE') . '' . '', - ) + ] ); ?>
@@ -54,11 +54,11 @@
quickicons) : foreach ($this->quickicons as $iconmodule) { - echo ModuleHelper::renderModule($iconmodule, array('style' => 'well')); + echo ModuleHelper::renderModule($iconmodule, ['style' => 'well']); } endif; foreach ($this->modules as $module) { - echo ModuleHelper::renderModule($module, array('style' => 'well')); + echo ModuleHelper::renderModule($module, ['style' => 'well']); } ?> authorise('core.create', 'com_modules')) : ?> diff --git a/administrator/components/com_fields/src/Controller/FieldController.php b/administrator/components/com_fields/src/Controller/FieldController.php index 646ddda70b250..3c545d869e2fe 100644 --- a/administrator/components/com_fields/src/Controller/FieldController.php +++ b/administrator/components/com_fields/src/Controller/FieldController.php @@ -60,7 +60,7 @@ class FieldController extends FormController * * @since 3.7.0 */ - public function __construct($config = array(), MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); @@ -78,7 +78,7 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu * * @since 3.7.0 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { return $this->app->getIdentity()->authorise('core.create', $this->component); } @@ -93,7 +93,7 @@ protected function allowAdd($data = array()) * * @since 3.7.0 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { $recordId = (int) isset($data[$key]) ? $data[$key] : 0; $user = $this->app->getIdentity(); @@ -183,7 +183,7 @@ protected function getRedirectToListAppend() * * @since 3.7.0 */ - protected function postSaveHook(BaseDatabaseModel $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { $item = $model->getItem(); diff --git a/administrator/components/com_fields/src/Controller/FieldsController.php b/administrator/components/com_fields/src/Controller/FieldsController.php index 088bff84b093b..0c9a42d77551a 100644 --- a/administrator/components/com_fields/src/Controller/FieldsController.php +++ b/administrator/components/com_fields/src/Controller/FieldsController.php @@ -43,7 +43,7 @@ class FieldsController extends AdminController * * @since 3.7.0 */ - public function getModel($name = 'Field', $prefix = 'Administrator', $config = array('ignore_request' => true)) + public function getModel($name = 'Field', $prefix = 'Administrator', $config = ['ignore_request' => true]) { return parent::getModel($name, $prefix, $config); } diff --git a/administrator/components/com_fields/src/Controller/GroupController.php b/administrator/components/com_fields/src/Controller/GroupController.php index 7016ed2f8fea0..c35621379c1bc 100644 --- a/administrator/components/com_fields/src/Controller/GroupController.php +++ b/administrator/components/com_fields/src/Controller/GroupController.php @@ -58,7 +58,7 @@ class GroupController extends FormController * * @since 3.7.0 */ - public function __construct($config = array(), MVCFactoryInterface $factory = null, $app = null, $input = null) + public function __construct($config = [], MVCFactoryInterface $factory = null, $app = null, $input = null) { parent::__construct($config, $factory, $app, $input); @@ -100,7 +100,7 @@ public function batch($model = null) * * @since 3.7.0 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { return $this->app->getIdentity()->authorise('core.create', $this->component); } @@ -115,7 +115,7 @@ protected function allowAdd($data = array()) * * @since 3.7.0 */ - protected function allowEdit($data = array(), $key = 'parent_id') + protected function allowEdit($data = [], $key = 'parent_id') { $recordId = (int) isset($data[$key]) ? $data[$key] : 0; $user = $this->app->getIdentity(); @@ -156,7 +156,7 @@ protected function allowEdit($data = array(), $key = 'parent_id') * * @since 3.7.0 */ - protected function postSaveHook(BaseDatabaseModel $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { $item = $model->getItem(); diff --git a/administrator/components/com_fields/src/Controller/GroupsController.php b/administrator/components/com_fields/src/Controller/GroupsController.php index 7568ded127c49..144a37dd38e80 100644 --- a/administrator/components/com_fields/src/Controller/GroupsController.php +++ b/administrator/components/com_fields/src/Controller/GroupsController.php @@ -43,7 +43,7 @@ class GroupsController extends AdminController * * @since 3.7.0 */ - public function getModel($name = 'Group', $prefix = 'Administrator', $config = array('ignore_request' => true)) + public function getModel($name = 'Group', $prefix = 'Administrator', $config = ['ignore_request' => true]) { return parent::getModel($name, $prefix, $config); } diff --git a/administrator/components/com_fields/src/Field/FieldLayoutField.php b/administrator/components/com_fields/src/Field/FieldLayoutField.php index 5be257ca42403..bc819de2af238 100644 --- a/administrator/components/com_fields/src/Field/FieldLayoutField.php +++ b/administrator/components/com_fields/src/Field/FieldLayoutField.php @@ -68,10 +68,10 @@ protected function getInput() $component_path = Path::clean(JPATH_SITE . '/components/' . $extension . '/layouts/field'); // Prepare array of component layouts - $component_layouts = array(); + $component_layouts = []; // Prepare the grouped list - $groups = array(); + $groups = []; // Add "Use Default" $groups[]['items'][] = HTMLHelper::_('select.option', '', Text::_('JOPTION_USE_DEFAULT')); @@ -79,10 +79,10 @@ protected function getInput() // Add the layout options from the component path. if (is_dir($component_path) && ($component_layouts = Folder::files($component_path, '^[^_]*\.php$', false, true))) { // Create the group for the component - $groups['_'] = array(); + $groups['_'] = []; $groups['_']['id'] = $this->id . '__'; $groups['_']['text'] = Text::sprintf('JOPTION_FROM_COMPONENT'); - $groups['_']['items'] = array(); + $groups['_']['items'] = []; foreach ($component_layouts as $i => $file) { // Add an option to the component group @@ -100,12 +100,12 @@ protected function getInput() // Loop on all templates if ($templates) { foreach ($templates as $template) { - $files = array(); - $template_paths = array( + $files = []; + $template_paths = [ Path::clean(JPATH_SITE . '/templates/' . $template->element . '/html/layouts/' . $extension . '/field'), Path::clean(JPATH_SITE . '/templates/' . $template->element . '/html/layouts/com_fields/field'), Path::clean(JPATH_SITE . '/templates/' . $template->element . '/html/layouts/field'), - ); + ]; // Add the layout options from the template paths. foreach ($template_paths as $template_path) { @@ -125,10 +125,10 @@ protected function getInput() if (count($files)) { // Create the group for the template - $groups[$template->name] = array(); + $groups[$template->name] = []; $groups[$template->name]['id'] = $this->id . '_' . $template->element; $groups[$template->name]['text'] = Text::sprintf('JOPTION_FROM_TEMPLATE', $template->name); - $groups[$template->name]['items'] = array(); + $groups[$template->name]['items'] = []; foreach ($files as $file) { // Add an option to the template group @@ -144,17 +144,17 @@ protected function getInput() $attr .= $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : ''; // Prepare HTML code - $html = array(); + $html = []; // Compute the current selected values - $selected = array($this->value); + $selected = [$this->value]; // Add a grouped list $html[] = HTMLHelper::_( 'select.groupedlist', $groups, $this->name, - array('id' => $this->id, 'group.id' => 'id', 'list.attr' => $attr, 'list.select' => $selected) + ['id' => $this->id, 'group.id' => 'id', 'list.attr' => $attr, 'list.select' => $selected] ); return implode($html); diff --git a/administrator/components/com_fields/src/Field/SubfieldsField.php b/administrator/components/com_fields/src/Field/SubfieldsField.php index 940c07b1818e4..3919442032175 100644 --- a/administrator/components/com_fields/src/Field/SubfieldsField.php +++ b/administrator/components/com_fields/src/Field/SubfieldsField.php @@ -55,7 +55,7 @@ class SubfieldsField extends ListField * * @since 4.0.0 */ - protected static $customFieldsCache = array(); + protected static $customFieldsCache = []; /** * Method to get the field options. diff --git a/administrator/components/com_fields/src/Helper/FieldsHelper.php b/administrator/components/com_fields/src/Helper/FieldsHelper.php index 99cd4d3ec17ce..aecf4dd923646 100644 --- a/administrator/components/com_fields/src/Helper/FieldsHelper.php +++ b/administrator/components/com_fields/src/Helper/FieldsHelper.php @@ -126,11 +126,11 @@ public static function getFields( } if (Multilanguage::isEnabled() && isset($item->language) && $item->language != '*') { - self::$fieldsCache->setState('filter.language', array('*', $item->language)); + self::$fieldsCache->setState('filter.language', ['*', $item->language]); } self::$fieldsCache->setState('filter.context', $context); - self::$fieldsCache->setState('filter.assigned_cat_ids', array()); + self::$fieldsCache->setState('filter.assigned_cat_ids', []); /* * If item has assigned_cat_ids parameter display only fields which @@ -152,7 +152,7 @@ public static function getFields( $fields = self::$fieldsCache->getItems(); if ($fields === false) { - return array(); + return []; } if ($item && isset($item->id)) { @@ -170,7 +170,7 @@ function ($f) { $fieldValues = self::$fieldCache->getFieldValues($fieldIds, $item->id); - $new = array(); + $new = []; foreach ($fields as $key => $original) { /* @@ -201,10 +201,10 @@ function ($f) { * On before field prepare * Event allow plugins to modify the output of the field before it is prepared */ - Factory::getApplication()->triggerEvent('onCustomFieldsBeforePrepareField', array($context, $item, &$field)); + Factory::getApplication()->triggerEvent('onCustomFieldsBeforePrepareField', [$context, $item, &$field]); // Gathering the value for the field - $value = Factory::getApplication()->triggerEvent('onCustomFieldsPrepareField', array($context, $item, &$field)); + $value = Factory::getApplication()->triggerEvent('onCustomFieldsPrepareField', [$context, $item, &$field]); if (is_array($value)) { $value = implode(' ', $value); @@ -214,7 +214,7 @@ function ($f) { * On after field render * Event allows plugins to modify the output of the prepared field */ - Factory::getApplication()->triggerEvent('onCustomFieldsAfterPrepareField', array($context, $item, $field, &$value)); + Factory::getApplication()->triggerEvent('onCustomFieldsAfterPrepareField', [$context, $item, $field, &$value]); // Assign the value $field->value = $value; @@ -254,12 +254,12 @@ public static function render($context, $layoutFile, $displayData) */ if ($parts = self::extract($context)) { // Trying to render the layout on the component from the context - $value = LayoutHelper::render($layoutFile, $displayData, null, array('component' => $parts[0], 'client' => 0)); + $value = LayoutHelper::render($layoutFile, $displayData, null, ['component' => $parts[0], 'client' => 0]); } if ($value == '') { // Trying to render the layout on Fields itself - $value = LayoutHelper::render($layoutFile, $displayData, null, array('component' => 'com_fields','client' => 0)); + $value = LayoutHelper::render($layoutFile, $displayData, null, ['component' => 'com_fields','client' => 0]); } return $value; @@ -347,7 +347,7 @@ public static function prepareForm($context, Form $form, $data) $fieldsNode->setAttribute('name', 'com_fields'); // Organizing the fields according to their group - $fieldsPerGroup = array(0 => array()); + $fieldsPerGroup = [0 => []]; foreach ($fields as $field) { if (!array_key_exists($field->type, $fieldTypes)) { @@ -356,7 +356,7 @@ public static function prepareForm($context, Form $form, $data) } if (!array_key_exists($field->group_id, $fieldsPerGroup)) { - $fieldsPerGroup[$field->group_id] = array(); + $fieldsPerGroup[$field->group_id] = []; } if ($path = $fieldTypes[$field->type]['path']) { @@ -385,7 +385,7 @@ public static function prepareForm($context, Form $form, $data) $defaultGroup->id = 0; $defaultGroup->title = ''; $defaultGroup->description = ''; - $iterateGroups = array_merge(array($defaultGroup), $model->getItems()); + $iterateGroups = array_merge([$defaultGroup], $model->getItems()); // Looping through the groups foreach ($iterateGroups as $group) { @@ -427,7 +427,7 @@ public static function prepareForm($context, Form $form, $data) // Looping through the fields for that context foreach ($fieldsPerGroup[$group->id] as $field) { try { - Factory::getApplication()->triggerEvent('onCustomFieldsPrepareDom', array($field, $fieldset, $form)); + Factory::getApplication()->triggerEvent('onCustomFieldsPrepareDom', [$field, $fieldset, $form]); /* * If the field belongs to an assigned_cat_id but the assigned_cat_ids in the data @@ -560,7 +560,7 @@ public static function getAssignedCategoriesIds($fieldId) $fieldId = (int) $fieldId; if (!$fieldId) { - return array(); + return []; } $db = Factory::getDbo(); @@ -650,7 +650,7 @@ public static function getFieldTypes() PluginHelper::importPlugin('fields'); $eventData = Factory::getApplication()->triggerEvent('onCustomFieldsGetTypes'); - $data = array(); + $data = []; foreach ($eventData as $fields) { foreach ($fields as $fieldDescription) { diff --git a/administrator/components/com_fields/src/Model/FieldModel.php b/administrator/components/com_fields/src/Model/FieldModel.php index b2bfc9a061aa8..8541b5aa5cc51 100644 --- a/administrator/components/com_fields/src/Model/FieldModel.php +++ b/administrator/components/com_fields/src/Model/FieldModel.php @@ -70,17 +70,17 @@ class FieldModel extends AdminModel * * @var array */ - protected $batch_commands = array( + protected $batch_commands = [ 'assetgroup_id' => 'batchAccess', 'language_id' => 'batchLanguage' - ); + ]; /** * @var array * * @since 3.7.0 */ - private $valueCache = array(); + private $valueCache = []; /** * Constructor @@ -91,7 +91,7 @@ class FieldModel extends AdminModel * @since 3.7.0 * @throws \Exception */ - public function __construct($config = array(), MVCFactoryInterface $factory = null) + public function __construct($config = [], MVCFactoryInterface $factory = null) { parent::__construct($config, $factory); @@ -168,16 +168,16 @@ public function save($data) if (!empty($data['only_use_in_subform'])) { $cats = [-1]; } else { - $cats = isset($data['assigned_cat_ids']) ? (array) $data['assigned_cat_ids'] : array(); + $cats = isset($data['assigned_cat_ids']) ? (array) $data['assigned_cat_ids'] : []; $cats = ArrayHelper::toInteger($cats); } - $assignedCatIds = array(); + $assignedCatIds = []; foreach ($cats as $cat) { // If we have found the 'JNONE' category, remove all other from the result and break. if ($cat == '-1') { - $assignedCatIds = array('-1'); + $assignedCatIds = ['-1']; break; } @@ -213,7 +213,7 @@ public function save($data) * when the options of a subfields field are getting changed. */ if ( - $field && in_array($field->type, array('list', 'checkboxes', 'radio'), true) + $field && in_array($field->type, ['list', 'checkboxes', 'radio'], true) && isset($data['fieldparams']['options']) && isset($field->fieldparams['options']) ) { $oldParams = $this->getParams($field->fieldparams['options']); @@ -280,7 +280,7 @@ private function checkDefaultValue($data) // Create the fields object $obj = (object) $data; $obj->params = new Registry($obj->params); - $obj->fieldparams = new Registry(!empty($obj->fieldparams) ? $obj->fieldparams : array()); + $obj->fieldparams = new Registry(!empty($obj->fieldparams) ? $obj->fieldparams : []); // Prepare the dom $dom = new \DOMDocument(); @@ -289,7 +289,7 @@ private function checkDefaultValue($data) // Trigger the event to create the field dom node $form = new Form($data['context']); $form->setDatabase($this->getDatabase()); - Factory::getApplication()->triggerEvent('onCustomFieldsPrepareDom', array($obj, $node, $form)); + Factory::getApplication()->triggerEvent('onCustomFieldsPrepareDom', [$obj, $node, $form]); // Check if a node is created if (!$node->firstChild) { @@ -396,7 +396,7 @@ public function getItem($pk = null) ->bind(':fieldid', $fieldId, ParameterType::INTEGER); $db->setQuery($query); - $result->assigned_cat_ids = $db->loadColumn() ?: array(0); + $result->assigned_cat_ids = $db->loadColumn() ?: [0]; } return $result; @@ -414,7 +414,7 @@ public function getItem($pk = null) * @since 3.7.0 * @throws \Exception */ - public function getTable($name = 'Field', $prefix = 'Administrator', $options = array()) + public function getTable($name = 'Field', $prefix = 'Administrator', $options = []) { // Default to text type $table = parent::getTable($name, $prefix, $options); @@ -439,15 +439,15 @@ protected function generateNewTitle($categoryId, $name, $title) // Alter the title & name $table = $this->getTable(); - while ($table->load(array('name' => $name))) { + while ($table->load(['name' => $name])) { $title = StringHelper::increment($title); $name = StringHelper::increment($name, 'dash'); } - return array( + return [ $title, $name, - ); + ]; } /** @@ -500,7 +500,7 @@ public function delete(&$pks) * * @since 3.7.0 */ - public function getForm($data = array(), $loadData = true) + public function getForm($data = [], $loadData = true) { $context = $this->getState('field.context'); $jinput = Factory::getApplication()->input; @@ -530,10 +530,10 @@ public function getForm($data = array(), $loadData = true) $form = $this->loadForm( 'com_fields.field.' . $context, 'field', - array( + [ 'control' => 'jform', 'load_data' => true, - ) + ] ); if (empty($form)) { @@ -660,10 +660,10 @@ public function setFieldValue($fieldId, $itemId, $value) $updateObj->item_id = $itemId; $updateObj->value = reset($value); - $this->getDatabase()->updateObject('#__fields_values', $updateObj, array('field_id', 'item_id')); + $this->getDatabase()->updateObject('#__fields_values', $updateObj, ['field_id', 'item_id']); } - $this->valueCache = array(); + $this->valueCache = []; FieldsHelper::clearFieldsCache(); return true; @@ -681,7 +681,7 @@ public function setFieldValue($fieldId, $itemId, $value) */ public function getFieldValue($fieldId, $itemId) { - $values = $this->getFieldValues(array($fieldId), $itemId); + $values = $this->getFieldValues([$fieldId], $itemId); if (array_key_exists($fieldId, $values)) { return $values[$fieldId]; @@ -703,7 +703,7 @@ public function getFieldValue($fieldId, $itemId) public function getFieldValues(array $fieldIds, $itemId) { if (!$fieldIds) { - return array(); + return []; } // Create a unique key for the cache @@ -723,7 +723,7 @@ public function getFieldValues(array $fieldIds, $itemId) // Fetch the row from the database $rows = $this->getDatabase()->setQuery($query)->loadObjectList(); - $data = array(); + $data = []; // Fill the data container from the database rows foreach ($rows as $row) { @@ -731,7 +731,7 @@ public function getFieldValues(array $fieldIds, $itemId) if (array_key_exists($row->field_id, $data)) { // Transform it to an array if (!is_array($data[$row->field_id])) { - $data[$row->field_id] = array($data[$row->field_id]); + $data[$row->field_id] = [$data[$row->field_id]]; } // Set the value in the array @@ -884,7 +884,7 @@ protected function loadFormData() { // Check the session for previously entered form data. $app = Factory::getApplication(); - $data = $app->getUserState('com_fields.edit.field.data', array()); + $data = $app->getUserState('com_fields.edit.field.data', []); if (empty($data)) { $data = $this->getItem(); @@ -1105,7 +1105,7 @@ protected function batchCopy($value, $pks, $contexts) // Set the variables $user = Factory::getUser(); $table = $this->getTable(); - $newIds = array(); + $newIds = []; $component = $this->state->get('filter.component'); $value = (int) $value; diff --git a/administrator/components/com_fields/src/Model/FieldsModel.php b/administrator/components/com_fields/src/Model/FieldsModel.php index a895dfcbddb08..ed0a4216f7835 100644 --- a/administrator/components/com_fields/src/Model/FieldsModel.php +++ b/administrator/components/com_fields/src/Model/FieldsModel.php @@ -40,10 +40,10 @@ class FieldsModel extends ListModel * @since 3.7.0 * @throws \Exception */ - public function __construct($config = array(), MVCFactoryInterface $factory = null) + public function __construct($config = [], MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { - $config['filter_fields'] = array( + $config['filter_fields'] = [ 'id', 'a.id', 'title', 'a.title', 'type', 'a.type', @@ -62,7 +62,7 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu 'category_id', 'a.category_id', 'group_id', 'a.group_id', 'assigned_cat_ids' - ); + ]; } parent::__construct($config, $factory); @@ -416,7 +416,7 @@ protected function _getList($query, $limitstart = 0, $limit = 0) * * @since 3.7.0 */ - public function getFilterForm($data = array(), $loadData = true) + public function getFilterForm($data = [], $loadData = true) { $form = parent::getFilterForm($data, $loadData); diff --git a/administrator/components/com_fields/src/Model/GroupModel.php b/administrator/components/com_fields/src/Model/GroupModel.php index 29e77d79f811c..7e7ede4f11d55 100644 --- a/administrator/components/com_fields/src/Model/GroupModel.php +++ b/administrator/components/com_fields/src/Model/GroupModel.php @@ -42,10 +42,10 @@ class GroupModel extends AdminModel * * @var array */ - protected $batch_commands = array( + protected $batch_commands = [ 'assetgroup_id' => 'batchAccess', 'language_id' => 'batchLanguage' - ); + ]; /** * Method to save the form data. @@ -81,7 +81,7 @@ public function save($data) * @since 3.7.0 * @throws \Exception */ - public function getTable($name = 'Group', $prefix = 'Administrator', $options = array()) + public function getTable($name = 'Group', $prefix = 'Administrator', $options = []) { return parent::getTable($name, $prefix, $options); } @@ -96,7 +96,7 @@ public function getTable($name = 'Group', $prefix = 'Administrator', $options = * * @since 3.7.0 */ - public function getForm($data = array(), $loadData = true) + public function getForm($data = [], $loadData = true) { $context = $this->getState('filter.context'); $jinput = Factory::getApplication()->input; @@ -110,10 +110,10 @@ public function getForm($data = array(), $loadData = true) $form = $this->loadForm( 'com_fields.group.' . $context, 'group', - array( + [ 'control' => 'jform', 'load_data' => $loadData, - ) + ] ); if (empty($form)) { @@ -302,7 +302,7 @@ protected function loadFormData() { // Check the session for previously entered form data. $app = Factory::getApplication(); - $data = $app->getUserState('com_fields.edit.group.data', array()); + $data = $app->getUserState('com_fields.edit.group.data', []); if (empty($data)) { $data = $this->getItem(); diff --git a/administrator/components/com_fields/src/Model/GroupsModel.php b/administrator/components/com_fields/src/Model/GroupsModel.php index 98e78e353bfc1..4ce0d3df7a89a 100644 --- a/administrator/components/com_fields/src/Model/GroupsModel.php +++ b/administrator/components/com_fields/src/Model/GroupsModel.php @@ -46,10 +46,10 @@ class GroupsModel extends ListModel * @since 3.7.0 * @throws \Exception */ - public function __construct($config = array(), MVCFactoryInterface $factory = null) + public function __construct($config = [], MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { - $config['filter_fields'] = array( + $config['filter_fields'] = [ 'id', 'a.id', 'title', 'a.title', 'type', 'a.type', @@ -62,7 +62,7 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu 'checked_out_time', 'a.checked_out_time', 'created', 'a.created', 'created_by', 'a.created_by', - ); + ]; } parent::__construct($config, $factory); diff --git a/administrator/components/com_fields/src/Plugin/FieldsListPlugin.php b/administrator/components/com_fields/src/Plugin/FieldsListPlugin.php index ce93f75f4c62e..abe4e1866b15b 100644 --- a/administrator/components/com_fields/src/Plugin/FieldsListPlugin.php +++ b/administrator/components/com_fields/src/Plugin/FieldsListPlugin.php @@ -67,13 +67,13 @@ public function onCustomFieldsPrepareDom($field, \DOMElement $parent, Form $form */ public function getOptionsFromField($field) { - $data = array(); + $data = []; // Fetch the options from the plugin $params = clone $this->params; $params->merge($field->fieldparams); - foreach ($params->get('options', array()) as $option) { + foreach ($params->get('options', []) as $option) { $op = (object) $option; $data[$op->value] = $op->name; } diff --git a/administrator/components/com_fields/src/Plugin/FieldsPlugin.php b/administrator/components/com_fields/src/Plugin/FieldsPlugin.php index 51a4cde390138..91a9e9e6e7f44 100644 --- a/administrator/components/com_fields/src/Plugin/FieldsPlugin.php +++ b/administrator/components/com_fields/src/Plugin/FieldsPlugin.php @@ -54,13 +54,13 @@ abstract class FieldsPlugin extends CMSPlugin public function onCustomFieldsGetTypes() { // Cache filesystem access / checks - static $types_cache = array(); + static $types_cache = []; if (isset($types_cache[$this->_type . $this->_name])) { return $types_cache[$this->_type . $this->_name]; } - $types = array(); + $types = []; // The root of the plugin $root = JPATH_PLUGINS . '/' . $this->_type . '/' . $this->_name; @@ -70,7 +70,7 @@ public function onCustomFieldsGetTypes() $layout = str_replace('.php', '', $layout); // The data array - $data = array(); + $data = []; // The language key $key = strtoupper($layout); diff --git a/administrator/components/com_fields/src/Table/FieldTable.php b/administrator/components/com_fields/src/Table/FieldTable.php index 5555e94ebb514..2d07b524be87f 100644 --- a/administrator/components/com_fields/src/Table/FieldTable.php +++ b/administrator/components/com_fields/src/Table/FieldTable.php @@ -77,10 +77,10 @@ public function bind($src, $ignore = '') // Make sure $registry->options contains no duplicates when the field type is subform if (isset($src['type']) && $src['type'] == 'subform' && isset($src['fieldparams']['options'])) { // Fast lookup map to check which custom field ids we have already seen - $seen_customfields = array(); + $seen_customfields = []; // Container for the new $src['fieldparams']['options'] - $options = array(); + $options = []; // Iterate through the old options $i = 0; @@ -148,7 +148,7 @@ public function check() // Verify that the name is unique $table = new static($this->_db); - if ($table->load(array('name' => $this->name)) && ($table->id != $this->id || $this->id == 0)) { + if ($table->load(['name' => $this->name]) && ($table->id != $this->id || $this->id == 0)) { $this->setError(Text::_('COM_FIELDS_ERROR_UNIQUE_NAME')); return false; diff --git a/administrator/components/com_fields/tmpl/field/edit.php b/administrator/components/com_fields/tmpl/field/edit.php index 1f3a11faa627d..db3ebff95821a 100644 --- a/administrator/components/com_fields/tmpl/field/edit.php +++ b/administrator/components/com_fields/tmpl/field/edit.php @@ -55,25 +55,25 @@
set( 'fields', - array( - array( + [ + [ 'published', 'state', 'enabled', - ), + ], 'group_id', 'assigned_cat_ids', 'access', 'language', 'note', - ) + ] ); ?> set('fields', null); ?>
- set('ignore_fieldsets', array('fieldparams')); ?> + set('ignore_fieldsets', ['fieldparams']); ?>
diff --git a/administrator/components/com_fields/tmpl/fields/default.php b/administrator/components/com_fields/tmpl/fields/default.php index 7bc0654bcc020..e0f5c4c72062c 100644 --- a/administrator/components/com_fields/tmpl/fields/default.php +++ b/administrator/components/com_fields/tmpl/fields/default.php @@ -61,7 +61,7 @@
- $this, 'options' => $searchToolsOptions)); ?> + $this, 'options' => $searchToolsOptions]); ?> items)) : ?>
@@ -208,10 +208,10 @@ Text::_('COM_FIELDS_VIEW_FIELDS_BATCH_OPTIONS'), 'footer' => $this->loadTemplate('batch_footer') - ), + ], $this->loadTemplate('batch_body') ); ?> diff --git a/administrator/components/com_fields/tmpl/fields/default_batch_body.php b/administrator/components/com_fields/tmpl/fields/default_batch_body.php index c5b1e0c000253..5bfe7949720c1 100644 --- a/administrator/components/com_fields/tmpl/fields/default_batch_body.php +++ b/administrator/components/com_fields/tmpl/fields/default_batch_body.php @@ -34,17 +34,17 @@
- +
-
'icon-trash', 0 => 'icon-times', 1 => 'icon-check', 2 => 'icon-folder', - ); + ]; foreach ($this->items as $i => $item) : ?> diff --git a/administrator/components/com_fields/tmpl/group/edit.php b/administrator/components/com_fields/tmpl/group/edit.php index 97bb6db49d931..917aa699da59b 100644 --- a/administrator/components/com_fields/tmpl/group/edit.php +++ b/administrator/components/com_fields/tmpl/group/edit.php @@ -41,23 +41,23 @@
set( 'fields', - array( - array( + [ + [ 'published', 'state', 'enabled', - ), + ], 'access', 'language', 'note', - ) + ] ); ?> set('fields', null); ?>
- set('ignore_fieldsets', array('fieldparams')); ?> + set('ignore_fieldsets', ['fieldparams']); ?>
diff --git a/administrator/components/com_fields/tmpl/groups/default.php b/administrator/components/com_fields/tmpl/groups/default.php index 1ce17a17d4c41..1bde8e30eb335 100644 --- a/administrator/components/com_fields/tmpl/groups/default.php +++ b/administrator/components/com_fields/tmpl/groups/default.php @@ -59,7 +59,7 @@
- $this, 'options' => $searchToolsOptions)); ?> + $this, 'options' => $searchToolsOptions]); ?> items)) : ?>
@@ -176,10 +176,10 @@ Text::_('COM_FIELDS_VIEW_GROUPS_BATCH_OPTIONS'), 'footer' => $this->loadTemplate('batch_footer') - ), + ], $this->loadTemplate('batch_body') ); ?> diff --git a/administrator/components/com_fields/tmpl/groups/default_batch_body.php b/administrator/components/com_fields/tmpl/groups/default_batch_body.php index 97e7bad090dc2..4561bbdf1afc5 100644 --- a/administrator/components/com_fields/tmpl/groups/default_batch_body.php +++ b/administrator/components/com_fields/tmpl/groups/default_batch_body.php @@ -25,7 +25,7 @@
- +
diff --git a/administrator/components/com_finder/src/Controller/DisplayController.php b/administrator/components/com_finder/src/Controller/DisplayController.php index ec4905231e7d2..a35ece9ccf8b0 100644 --- a/administrator/components/com_finder/src/Controller/DisplayController.php +++ b/administrator/components/com_finder/src/Controller/DisplayController.php @@ -46,7 +46,7 @@ class DisplayController extends BaseController * * @since 2.5 */ - public function display($cachable = false, $urlparams = array()) + public function display($cachable = false, $urlparams = []) { $view = $this->input->get('view', 'index', 'word'); $layout = $this->input->get('layout', 'index', 'word'); diff --git a/administrator/components/com_finder/src/Controller/FilterController.php b/administrator/components/com_finder/src/Controller/FilterController.php index 5c65fcd6c8e3e..b48585d2f6de1 100644 --- a/administrator/components/com_finder/src/Controller/FilterController.php +++ b/administrator/components/com_finder/src/Controller/FilterController.php @@ -44,7 +44,7 @@ public function save($key = null, $urlVar = null) /** @var \Joomla\Component\Finder\Administrator\Model\FilterModel $model */ $model = $this->getModel(); $table = $model->getTable(); - $data = $this->input->post->get('jform', array(), 'array'); + $data = $this->input->post->get('jform', [], 'array'); $checkin = $table->hasField('checked_out'); $context = "$this->option.edit.$this->context"; $task = $this->getTask(); @@ -138,7 +138,7 @@ public function save($key = null, $urlVar = null) } // Get and sanitize the filter data. - $validData['data'] = $this->input->post->get('t', array(), 'array'); + $validData['data'] = $this->input->post->get('t', [], 'array'); $validData['data'] = array_unique($validData['data']); $validData['data'] = ArrayHelper::toInteger($validData['data']); diff --git a/administrator/components/com_finder/src/Controller/FiltersController.php b/administrator/components/com_finder/src/Controller/FiltersController.php index 39faa67c2a3ec..89c02dc0c1a17 100644 --- a/administrator/components/com_finder/src/Controller/FiltersController.php +++ b/administrator/components/com_finder/src/Controller/FiltersController.php @@ -42,7 +42,7 @@ class FiltersController extends AdminController * * @since 2.5 */ - public function getModel($name = 'Filter', $prefix = 'Administrator', $config = array('ignore_request' => true)) + public function getModel($name = 'Filter', $prefix = 'Administrator', $config = ['ignore_request' => true]) { return parent::getModel($name, $prefix, $config); } diff --git a/administrator/components/com_finder/src/Controller/IndexController.php b/administrator/components/com_finder/src/Controller/IndexController.php index 4a06e478c158f..042253c2f23bc 100644 --- a/administrator/components/com_finder/src/Controller/IndexController.php +++ b/administrator/components/com_finder/src/Controller/IndexController.php @@ -37,7 +37,7 @@ class IndexController extends AdminController * * @since 2.5 */ - public function getModel($name = 'Index', $prefix = 'Administrator', $config = array('ignore_request' => true)) + public function getModel($name = 'Index', $prefix = 'Administrator', $config = ['ignore_request' => true]) { return parent::getModel($name, $prefix, $config); } diff --git a/administrator/components/com_finder/src/Controller/IndexerController.php b/administrator/components/com_finder/src/Controller/IndexerController.php index ac732a3d91b4e..c585da58fa169 100644 --- a/administrator/components/com_finder/src/Controller/IndexerController.php +++ b/administrator/components/com_finder/src/Controller/IndexerController.php @@ -155,13 +155,13 @@ public function batch() $lang = Factory::getLanguage(); // Get the document properties. - $attributes = array ( + $attributes = [ 'charset' => 'utf-8', 'lineend' => 'unix', 'tab' => ' ', 'language' => $lang->getTag(), 'direction' => $lang->isRtl() ? 'rtl' : 'ltr' - ); + ]; // Start the indexer. try { diff --git a/administrator/components/com_finder/src/Controller/MapsController.php b/administrator/components/com_finder/src/Controller/MapsController.php index b94c9ee1b621a..2d82754789a1c 100644 --- a/administrator/components/com_finder/src/Controller/MapsController.php +++ b/administrator/components/com_finder/src/Controller/MapsController.php @@ -42,7 +42,7 @@ class MapsController extends AdminController * * @since 1.6 */ - public function getModel($name = 'Maps', $prefix = 'Administrator', $config = array('ignore_request' => true)) + public function getModel($name = 'Maps', $prefix = 'Administrator', $config = ['ignore_request' => true]) { return parent::getModel($name, $prefix, $config); } diff --git a/administrator/components/com_finder/src/Field/ContentmapField.php b/administrator/components/com_finder/src/Field/ContentmapField.php index 9d66f648bc1b5..90916ee7635fd 100644 --- a/administrator/components/com_finder/src/Field/ContentmapField.php +++ b/administrator/components/com_finder/src/Field/ContentmapField.php @@ -44,7 +44,7 @@ class ContentmapField extends GroupedlistField */ protected function getGroups() { - $groups = array(); + $groups = []; // Get the database object and a new query object. $db = $this->getDatabase(); diff --git a/administrator/components/com_finder/src/Field/ContenttypesField.php b/administrator/components/com_finder/src/Field/ContenttypesField.php index 912d849c2edab..51b041bb39271 100644 --- a/administrator/components/com_finder/src/Field/ContenttypesField.php +++ b/administrator/components/com_finder/src/Field/ContenttypesField.php @@ -46,7 +46,7 @@ class ContenttypesField extends ListField public function getOptions() { $lang = Factory::getLanguage(); - $options = array(); + $options = []; $db = $this->getDatabase(); $query = $db->getQuery(true) diff --git a/administrator/components/com_finder/src/Helper/LanguageHelper.php b/administrator/components/com_finder/src/Helper/LanguageHelper.php index 588088a98d152..b027bd32936b8 100644 --- a/administrator/components/com_finder/src/Helper/LanguageHelper.php +++ b/administrator/components/com_finder/src/Helper/LanguageHelper.php @@ -125,7 +125,7 @@ public static function loadPluginLanguage() // Get array of all the enabled Smart Search plugin names. $db = Factory::getDbo(); $query = $db->getQuery(true) - ->select(array($db->quoteName('name'), $db->quoteName('element'))) + ->select([$db->quoteName('name'), $db->quoteName('element')]) ->from($db->quoteName('#__extensions')) ->where($db->quoteName('type') . ' = ' . $db->quote('plugin')) ->where($db->quoteName('folder') . ' = ' . $db->quote('finder')) diff --git a/administrator/components/com_finder/src/Indexer/Adapter.php b/administrator/components/com_finder/src/Indexer/Adapter.php index 0db12092b3888..494b8f44545b0 100644 --- a/administrator/components/com_finder/src/Indexer/Adapter.php +++ b/administrator/components/com_finder/src/Indexer/Adapter.php @@ -388,7 +388,7 @@ protected function remove($id, $removeTaxonomies = true) // Check the items. if (empty($items)) { - Factory::getApplication()->triggerEvent('onFinderIndexAfterDelete', array($id)); + Factory::getApplication()->triggerEvent('onFinderIndexAfterDelete', [$id]); return true; } diff --git a/administrator/components/com_finder/src/Indexer/Helper.php b/administrator/components/com_finder/src/Indexer/Helper.php index a6e7b26130c62..a661a05f6ca60 100644 --- a/administrator/components/com_finder/src/Indexer/Helper.php +++ b/administrator/components/com_finder/src/Indexer/Helper.php @@ -101,7 +101,7 @@ public static function tokenize($input, $lang, $phrase = false) $cache[$lang] = []; } - $tokens = array(); + $tokens = []; $terms = $language->tokenise($input); // @todo: array_filter removes any number 0's from the terms. Not sure this is entirely intended @@ -131,7 +131,7 @@ public static function tokenize($input, $lang, $phrase = false) // Create multi-word phrase tokens from the individual words. if ($tuplecount > 1) { for ($i = 0, $n = count($tokens); $i < $n; $i++) { - $temp = array($tokens[$i]->term); + $temp = [$tokens[$i]->term]; // Create tokens for 2 to $tuplecount length phrases for ($j = 1; $j < $tuplecount; $j++) { @@ -243,7 +243,7 @@ public static function addContentType($title, $mime = null) // Add the type. $query->clear() ->insert($db->quoteName('#__finder_types')) - ->columns(array($db->quoteName('title'), $db->quoteName('mime'))) + ->columns([$db->quoteName('title'), $db->quoteName('mime')]) ->values($db->quote($title) . ', ' . $db->quote($mime)); $db->setQuery($query); $db->execute(); @@ -352,7 +352,7 @@ public static function getPrimaryLanguage($lang) // Only parse the identifier if necessary. if (!isset($data[$lang])) { - if (is_callable(array('Locale', 'getPrimaryLanguage'))) { + if (is_callable(['Locale', 'getPrimaryLanguage'])) { // Get the language key using the Locale package. $data[$lang] = \Locale::getPrimaryLanguage($lang); } else { @@ -380,7 +380,7 @@ public static function getContentExtras(Result $item) // Load the finder plugin group. PluginHelper::importPlugin('finder'); - Factory::getApplication()->triggerEvent('onPrepareFinderContent', array(&$item)); + Factory::getApplication()->triggerEvent('onPrepareFinderContent', [&$item]); return true; } @@ -426,7 +426,7 @@ public static function prepareContent($text, $params = null, Result $item = null } // Fire the onContentPrepare event. - Factory::getApplication()->triggerEvent('onContentPrepare', array('com_finder.indexer', &$content, &$params, 0)); + Factory::getApplication()->triggerEvent('onContentPrepare', ['com_finder.indexer', &$content, &$params, 0]); return $content->text; } diff --git a/administrator/components/com_finder/src/Indexer/Indexer.php b/administrator/components/com_finder/src/Indexer/Indexer.php index 0692130bedbbe..f4a15a4acdfdd 100644 --- a/administrator/components/com_finder/src/Indexer/Indexer.php +++ b/administrator/components/com_finder/src/Indexer/Indexer.php @@ -132,7 +132,7 @@ public function __construct(DatabaseInterface $db = null) // Set up query template for addTokensToDb $this->addTokensToDbQueryTemplate = $db->getQuery(true)->insert($db->quoteName('#__finder_tokens')) ->columns( - array( + [ $db->quoteName('term'), $db->quoteName('stem'), $db->quoteName('common'), @@ -140,7 +140,7 @@ public function __construct(DatabaseInterface $db = null) $db->quoteName('weight'), $db->quoteName('context'), $db->quoteName('language') - ) + ] ); } @@ -197,13 +197,13 @@ public static function getState() } // Setup the weight lookup information. - $data->weights = array( + $data->weights = [ self::TITLE_CONTEXT => round($data->options->get('title_multiplier', 1.7), 2), self::TEXT_CONTEXT => round($data->options->get('text_multiplier', 0.7), 2), self::META_CONTEXT => round($data->options->get('meta_multiplier', 1.2), 2), self::PATH_CONTEXT => round($data->options->get('path_multiplier', 2.0), 2), self::MISC_CONTEXT => round($data->options->get('misc_multiplier', 0.3), 2) - ); + ]; // Set the current time as the start time. $data->startTime = Factory::getDate()->toSql(); @@ -212,7 +212,7 @@ public static function getState() $data->batchSize = (int) $data->options->get('batch_size', 50); $data->batchOffset = 0; $data->totalItems = 0; - $data->pluginState = array(); + $data->pluginState = []; } // Setup the profiler if debugging is enabled. @@ -411,7 +411,7 @@ public function index($item, $format = 'html') */ if ($group === static::PATH_CONTEXT) { $ip = File::stripExt($ip); - $ip = str_replace(array('/', '-'), ' ', $ip); + $ip = str_replace(['/', '-'], ' ', $ip); } // Tokenize a string of content and add it to the database. @@ -629,7 +629,7 @@ public function index($item, $format = 'html') // Trigger a plugin event after indexing PluginHelper::importPlugin('finder'); - Factory::getApplication()->triggerEvent('onFinderIndexAfterIndex', array($item, $linkId)); + Factory::getApplication()->triggerEvent('onFinderIndexAfterIndex', [$item, $linkId]); return $linkId; } @@ -689,7 +689,7 @@ public function remove($linkId, $removeTaxonomies = true) } PluginHelper::importPlugin('finder'); - Factory::getApplication()->triggerEvent('onFinderIndexAfterDelete', array($linkId)); + Factory::getApplication()->triggerEvent('onFinderIndexAfterDelete', [$linkId]); return true; } @@ -788,13 +788,13 @@ protected static function getSignature($item) $state = static::getState(); // Get the relevant configuration variables. - $config = array( + $config = [ $state->weights, $state->options->get('tuplecount', 1), $state->options->get('language_default', '') - ); + ]; - return md5(serialize(array($item, $config))); + return md5(serialize([$item, $config])); } /** diff --git a/administrator/components/com_finder/src/Indexer/Language.php b/administrator/components/com_finder/src/Indexer/Language.php index db138cf078c60..fac1a702708c2 100644 --- a/administrator/components/com_finder/src/Indexer/Language.php +++ b/administrator/components/com_finder/src/Indexer/Language.php @@ -32,7 +32,7 @@ class Language * @var Language[] * @since 4.0.0 */ - protected static $instances = array(); + protected static $instances = []; /** * Language locale of the class diff --git a/administrator/components/com_finder/src/Indexer/Language/El.php b/administrator/components/com_finder/src/Indexer/Language/El.php index 9a9c8c55dece6..ceb4790b266db 100644 --- a/administrator/components/com_finder/src/Indexer/Language/El.php +++ b/administrator/components/com_finder/src/Indexer/Language/El.php @@ -341,7 +341,7 @@ public function stem($token) // Step 1 // step1list is used in Step 1. 41 stems - $step1list = array(); + $step1list = []; $step1list["ΦΑΓΙΑ"] = "ΦΑ"; $step1list["ΦΑΓΙΟΥ"] = "ΦΑ"; $step1list["ΦΑΓΙΩΝ"] = "ΦΑ"; @@ -772,7 +772,7 @@ public function stem($token) protected function toUpperCase($token, &$wCase) { $wCase = array_fill(0, mb_strlen($token, 'UTF-8'), 0); - $caseConvert = array( + $caseConvert = [ "α" => 'Α', "β" => 'Β', "γ" => 'Γ', @@ -809,7 +809,7 @@ protected function toUpperCase($token, &$wCase) "ϋ" => 'Ι', "ΐ" => 'Ι', "ΰ" => 'Υ', - ); + ]; $newToken = ''; for ($i = 0; $i < mb_strlen($token); $i++) { diff --git a/administrator/components/com_finder/src/Indexer/Language/Zh.php b/administrator/components/com_finder/src/Indexer/Language/Zh.php index 5a230d8f27f36..24b27e5fb3e7e 100644 --- a/administrator/components/com_finder/src/Indexer/Language/Zh.php +++ b/administrator/components/com_finder/src/Indexer/Language/Zh.php @@ -65,7 +65,7 @@ public function tokenise($input) // Iterate through the terms and test if they contain Chinese. for ($i = 0, $n = count($terms); $i < $n; $i++) { - $charMatches = array(); + $charMatches = []; $charCount = preg_match_all('#[\p{Han}]#mui', $terms[$i], $charMatches); // Split apart any groups of Chinese characters. diff --git a/administrator/components/com_finder/src/Indexer/Parser.php b/administrator/components/com_finder/src/Indexer/Parser.php index 71eef447cca2b..6bf308f3f7c81 100644 --- a/administrator/components/com_finder/src/Indexer/Parser.php +++ b/administrator/components/com_finder/src/Indexer/Parser.php @@ -30,7 +30,7 @@ abstract class Parser * @var Parser[] * @since 4.0.0 */ - protected static $instances = array(); + protected static $instances = []; /** * Method to get a parser, creating it if necessary. diff --git a/administrator/components/com_finder/src/Indexer/Parser/Html.php b/administrator/components/com_finder/src/Indexer/Parser/Html.php index c5429de3dfea0..001df97e0e342 100644 --- a/administrator/components/com_finder/src/Indexer/Parser/Html.php +++ b/administrator/components/com_finder/src/Indexer/Parser/Html.php @@ -49,14 +49,14 @@ public function parse($input) // Convert
'; - $html[] = ' ' . LayoutHelper::render('joomla.html.treeprefix', array('level' => $group->level + 1)) . $group->text; + $html[] = ' ' . LayoutHelper::render('joomla.html.treeprefix', ['level' => $group->level + 1]) . $group->text; $html[] = ' '; $html[] = '