From 1e7527b60ec42032abe7bfb9c000bacf38f65845 Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Tue, 31 Jan 2023 11:20:05 +0100 Subject: [PATCH] Fixes various code style issues and integrate PHP CS Fixer into drone (#39745) * Integrate PHP CS Fixer into drone * Fix code base * more verbose * Ignore psr12 scripts * Test * revert * Ignore also rebase script * Align array and variable declarations * Merges * Fix the no break comment starting with upper case * Fix alignment in arrays * Article controller alignment --- .drone.yml | 1 + .php-cs-fixer.dist.php | 43 ++- .../com_actionlogs/services/provider.php | 3 +- .../com_actionlogs/src/Field/LogtypeField.php | 2 +- .../src/Helper/ActionlogsHelper.php | 8 +- .../src/Model/ActionlogModel.php | 6 +- administrator/components/com_admin/script.php | 32 +- .../com_admin/services/provider.php | 3 +- .../com_admin/src/Model/HelpModel.php | 2 +- .../com_admin/src/Model/SysinfoModel.php | 40 +- .../com_admin/src/View/Sysinfo/JsonView.php | 2 +- .../com_admin/src/View/Sysinfo/TextView.php | 14 +- .../com_associations/services/provider.php | 3 +- .../src/Field/ItemtypeField.php | 2 +- .../src/Field/Modal/AssociationField.php | 16 +- .../src/Helper/AssociationsHelper.php | 2 +- .../src/Model/AssociationsModel.php | 2 +- .../src/View/Associations/HtmlView.php | 10 +- .../com_banners/services/provider.php | 3 +- .../src/Controller/BannersController.php | 2 +- .../com_banners/src/Helper/BannersHelper.php | 12 +- .../com_banners/src/Model/BannerModel.php | 8 +- .../com_banners/src/Model/BannersModel.php | 4 +- .../com_banners/src/Model/ClientsModel.php | 12 +- .../com_banners/src/Model/TracksModel.php | 10 +- .../com_banners/src/Service/Html/Banner.php | 6 +- .../com_banners/src/Table/BannerTable.php | 12 +- .../com_banners/src/View/Tracks/HtmlView.php | 2 +- .../com_cache/services/provider.php | 3 +- .../com_cache/src/Model/CacheModel.php | 2 +- .../com_categories/services/provider.php | 3 +- .../src/Controller/CategoriesController.php | 2 +- .../src/Controller/CategoryController.php | 6 +- .../src/Field/CategoryeditField.php | 17 +- .../src/Field/ComponentsCategoryField.php | 3 +- .../src/Field/Modal/CategoryField.php | 20 +- .../src/Helper/CategoriesHelper.php | 4 +- .../src/Model/CategoriesModel.php | 12 +- .../src/Model/CategoryModel.php | 56 +-- .../src/Service/HTML/AdministratorService.php | 4 +- .../src/View/Categories/HtmlView.php | 5 +- .../src/View/Category/HtmlView.php | 16 +- .../com_checkin/services/provider.php | 3 +- .../com_config/services/provider.php | 3 +- .../src/Controller/ApplicationController.php | 4 +- .../src/Controller/RequestController.php | 2 +- .../com_config/src/Helper/ConfigHelper.php | 6 +- .../com_config/src/Model/ApplicationModel.php | 30 +- .../com_config/src/Model/ComponentModel.php | 6 +- .../src/View/Component/HtmlView.php | 4 +- .../com_contact/services/provider.php | 3 +- .../src/Controller/ContactController.php | 8 +- .../src/Controller/ContactsController.php | 2 +- .../src/Extension/ContactComponent.php | 2 +- .../src/Field/Modal/ContactField.php | 20 +- .../src/Helper/AssociationsHelper.php | 28 +- .../com_contact/src/Model/ContactModel.php | 12 +- .../com_contact/src/Model/ContactsModel.php | 14 +- .../src/Service/HTML/AdministratorService.php | 14 +- .../com_contact/src/Service/HTML/Icon.php | 4 +- .../com_contact/src/Table/ContactTable.php | 2 +- .../com_content/services/provider.php | 3 +- .../src/Controller/ArticleController.php | 13 +- .../src/Controller/ArticlesController.php | 2 +- .../src/Controller/FeaturedController.php | 2 +- .../src/Event/Model/FeatureEvent.php | 2 +- .../src/Extension/ContentComponent.php | 18 +- .../src/Field/Modal/ArticleField.php | 18 +- .../src/Helper/AssociationsHelper.php | 28 +- .../com_content/src/Model/ArticleModel.php | 38 +- .../com_content/src/Model/ArticlesModel.php | 12 +- .../src/Service/HTML/AdministratorService.php | 4 +- .../com_content/src/Service/HTML/Icon.php | 4 +- .../src/View/Articles/HtmlView.php | 6 +- .../src/View/Featured/HtmlView.php | 6 +- .../com_contenthistory/services/provider.php | 3 +- .../src/Helper/ContenthistoryHelper.php | 36 +- .../src/Model/CompareModel.php | 8 +- .../src/Model/HistoryModel.php | 16 +- .../src/Model/PreviewModel.php | 12 +- .../src/View/History/HtmlView.php | 4 +- .../com_cpanel/services/provider.php | 3 +- .../com_cpanel/src/View/Cpanel/HtmlView.php | 10 +- .../com_fields/services/provider.php | 3 +- .../src/Controller/FieldController.php | 4 +- .../src/Controller/GroupController.php | 2 +- .../src/Field/ComponentsFieldgroupField.php | 6 +- .../src/Field/ComponentsFieldsField.php | 6 +- .../com_fields/src/Field/FieldLayoutField.php | 20 +- .../com_fields/src/Field/FieldgroupsField.php | 2 +- .../com_fields/src/Helper/FieldsHelper.php | 10 +- .../com_fields/src/Model/FieldModel.php | 28 +- .../com_fields/src/Model/FieldsModel.php | 12 +- .../com_fields/src/Model/GroupModel.php | 4 +- .../com_fields/src/Model/GroupsModel.php | 6 +- .../src/Plugin/FieldsListPlugin.php | 4 +- .../com_fields/src/Table/FieldTable.php | 8 +- .../com_fields/src/Table/GroupTable.php | 6 +- .../com_finder/services/provider.php | 3 +- .../src/Controller/DisplayController.php | 6 +- .../src/Controller/FilterController.php | 10 +- .../src/Controller/IndexerController.php | 18 +- .../com_finder/src/Field/ContentmapField.php | 6 +- .../src/Field/ContenttypesField.php | 2 +- .../src/Field/SearchfilterField.php | 2 +- .../com_finder/src/Helper/LanguageHelper.php | 4 +- .../com_finder/src/Indexer/Adapter.php | 12 +- .../com_finder/src/Indexer/Helper.php | 28 +- .../com_finder/src/Indexer/Indexer.php | 60 +-- .../com_finder/src/Indexer/Language/El.php | 10 +- .../com_finder/src/Indexer/Language/Zh.php | 2 +- .../com_finder/src/Indexer/Parser.php | 6 +- .../com_finder/src/Indexer/Parser/Html.php | 6 +- .../com_finder/src/Indexer/Query.php | 10 +- .../com_finder/src/Indexer/Result.php | 28 +- .../com_finder/src/Indexer/Taxonomy.php | 52 +-- .../com_finder/src/Indexer/Token.php | 20 +- .../com_finder/src/Model/FiltersModel.php | 4 +- .../com_finder/src/Model/IndexModel.php | 32 +- .../com_finder/src/Model/MapsModel.php | 8 +- .../com_finder/src/Model/SearchesModel.php | 2 +- .../com_finder/src/Model/StatisticsModel.php | 6 +- .../com_finder/src/Response/Response.php | 20 +- .../com_finder/src/Service/HTML/Filter.php | 4 +- .../com_finder/src/Service/HTML/Finder.php | 6 +- .../com_finder/src/Service/HTML/Query.php | 8 +- .../com_finder/src/Table/FilterTable.php | 6 +- .../com_finder/src/View/Filter/HtmlView.php | 14 +- .../com_installer/services/provider.php | 3 +- .../src/Controller/UpdateController.php | 2 +- .../src/Helper/InstallerHelper.php | 2 +- .../com_installer/src/Model/DatabaseModel.php | 14 +- .../com_installer/src/Model/DiscoverModel.php | 12 +- .../com_installer/src/Model/InstallModel.php | 14 +- .../src/Model/InstallerModel.php | 14 +- .../com_installer/src/Model/ManageModel.php | 10 +- .../com_installer/src/Model/UpdateModel.php | 8 +- .../src/Model/UpdatesiteModel.php | 4 +- .../src/Model/UpdatesitesModel.php | 8 +- .../src/View/Update/HtmlView.php | 2 +- .../src/View/Updatesite/HtmlView.php | 2 +- .../components/com_joomlaupdate/extract.php | 8 +- .../com_joomlaupdate/services/provider.php | 3 +- .../src/Controller/UpdateController.php | 56 +-- .../src/Model/UpdateModel.php | 154 ++++---- .../src/View/Joomlaupdate/HtmlView.php | 2 +- .../src/View/Upload/HtmlView.php | 4 +- .../com_languages/services/provider.php | 3 +- .../src/Controller/InstalledController.php | 20 +- .../src/Controller/LanguagesController.php | 2 +- .../src/Controller/OverrideController.php | 2 +- .../src/Helper/MultilangstatusHelper.php | 12 +- .../src/Model/InstalledModel.php | 6 +- .../com_languages/src/Model/LanguageModel.php | 4 +- .../src/Model/LanguagesModel.php | 2 +- .../com_languages/src/Model/OverrideModel.php | 4 +- .../src/Model/OverridesModel.php | 8 +- .../com_languages/src/Model/StringsModel.php | 8 +- .../src/Service/HTML/Languages.php | 2 +- .../src/View/Overrides/HtmlView.php | 2 +- .../com_login/services/provider.php | 3 +- .../src/Controller/DisplayController.php | 4 +- .../com_login/src/Model/LoginModel.php | 24 +- .../com_mails/services/provider.php | 3 +- .../src/Controller/TemplateController.php | 12 +- .../com_mails/src/Model/TemplateModel.php | 26 +- .../com_mails/src/Model/TemplatesModel.php | 6 +- .../com_mails/src/View/Template/HtmlView.php | 12 +- .../com_mails/src/View/Templates/HtmlView.php | 2 +- .../com_media/services/provider.php | 3 +- .../src/Event/FetchMediaItemUrlEvent.php | 2 +- .../src/Plugin/MediaActionPlugin.php | 2 +- .../Provider/ProviderManagerHelperTrait.php | 2 +- .../layouts/joomla/searchtools/default.php | 2 +- .../com_menus/services/provider.php | 3 +- .../src/Controller/ItemController.php | 12 +- .../src/Controller/ItemsController.php | 8 +- .../src/Controller/MenusController.php | 4 +- .../src/Field/MenuItemByTypeField.php | 4 +- .../com_menus/src/Field/MenuOrderingField.php | 2 +- .../com_menus/src/Field/MenuParentField.php | 2 +- .../com_menus/src/Field/MenutypeField.php | 6 +- .../com_menus/src/Field/Modal/MenuField.php | 28 +- .../src/Helper/AssociationsHelper.php | 20 +- .../com_menus/src/Helper/MenusHelper.php | 8 +- .../com_menus/src/Model/ItemModel.php | 50 +-- .../com_menus/src/Model/ItemsModel.php | 2 +- .../com_menus/src/Model/MenusModel.php | 2 +- .../com_menus/src/Model/MenutypesModel.php | 16 +- .../com_menus/src/Service/HTML/Menus.php | 4 +- .../com_menus/src/View/Items/HtmlView.php | 4 +- .../com_menus/src/View/Menu/XmlView.php | 4 +- .../com_messages/services/provider.php | 3 +- .../src/Field/UserMessagesField.php | 2 +- .../com_messages/src/Model/ConfigModel.php | 2 +- .../com_messages/src/Model/MessageModel.php | 16 +- .../com_messages/src/Model/MessagesModel.php | 6 +- .../src/View/Message/HtmlView.php | 2 +- .../com_modules/services/provider.php | 3 +- .../src/Controller/ModuleController.php | 14 +- .../src/Controller/ModulesController.php | 2 +- .../com_modules/src/Helper/ModulesHelper.php | 26 +- .../com_modules/src/Model/ModuleModel.php | 22 +- .../com_modules/src/Model/ModulesModel.php | 8 +- .../com_modules/src/Model/PositionsModel.php | 6 +- .../com_modules/src/Model/SelectModel.php | 4 +- .../com_modules/src/Service/HTML/Modules.php | 14 +- .../com_modules/src/View/Module/HtmlView.php | 2 +- .../com_modules/src/View/Select/HtmlView.php | 4 +- .../com_newsfeeds/services/provider.php | 3 +- .../src/Controller/NewsfeedController.php | 2 +- .../src/Controller/NewsfeedsController.php | 2 +- .../src/Field/Modal/NewsfeedField.php | 20 +- .../src/Helper/AssociationsHelper.php | 28 +- .../src/Helper/NewsfeedsHelper.php | 12 +- .../com_newsfeeds/src/Model/NewsfeedModel.php | 16 +- .../src/Service/HTML/AdministratorService.php | 4 +- .../com_plugins/services/provider.php | 3 +- .../src/Controller/PluginsController.php | 2 +- .../src/Field/PluginorderingField.php | 2 +- .../com_plugins/src/Helper/PluginsHelper.php | 6 +- .../com_plugins/src/Model/PluginModel.php | 12 +- .../com_plugins/src/Model/PluginsModel.php | 12 +- .../com_plugins/src/View/Plugin/HtmlView.php | 2 +- .../com_plugins/src/View/Plugins/HtmlView.php | 8 +- .../com_postinstall/services/provider.php | 3 +- .../src/Controller/MessageController.php | 6 +- .../src/Model/MessagesModel.php | 10 +- .../src/View/Messages/HtmlView.php | 2 +- .../com_privacy/services/provider.php | 3 +- .../com_privacy/src/Model/ConsentsModel.php | 4 +- .../com_privacy/src/Model/ExportModel.php | 2 +- .../com_privacy/src/Plugin/PrivacyPlugin.php | 2 +- .../com_redirect/services/provider.php | 3 +- .../src/Controller/DisplayController.php | 2 +- .../src/Controller/LinksController.php | 2 +- .../com_redirect/src/Model/LinkModel.php | 4 +- .../com_redirect/src/Model/LinksModel.php | 2 +- .../com_redirect/src/Table/LinkTable.php | 2 +- .../com_scheduler/services/provider.php | 3 +- .../com_scheduler/src/Field/CronField.php | 2 +- .../com_scheduler/src/Model/TaskModel.php | 2 +- .../com_scheduler/src/Model/TasksModel.php | 2 +- .../com_scheduler/src/Scheduler/Scheduler.php | 4 +- .../com_scheduler/src/Task/Task.php | 2 +- .../components/com_tags/services/provider.php | 3 +- .../src/Controller/TagsController.php | 2 +- .../com_tags/src/Model/TagModel.php | 12 +- .../com_tags/src/Table/TagTable.php | 2 +- .../com_templates/services/provider.php | 3 +- .../src/Controller/StyleController.php | 6 +- .../src/Controller/TemplateController.php | 10 +- .../src/Helper/TemplateHelper.php | 4 +- .../src/Helper/TemplatesHelper.php | 6 +- .../com_templates/src/Model/StyleModel.php | 12 +- .../com_templates/src/Model/StylesModel.php | 4 +- .../com_templates/src/Model/TemplateModel.php | 84 ++-- .../src/Model/TemplatesModel.php | 6 +- .../com_templates/src/Table/StyleTable.php | 8 +- .../com_templates/src/View/Style/HtmlView.php | 2 +- .../src/View/Template/HtmlView.php | 4 +- .../com_users/services/provider.php | 3 +- .../src/Controller/MethodController.php | 2 +- .../src/Controller/UsersController.php | 2 +- .../com_users/src/Field/GroupparentField.php | 2 +- .../com_users/src/Helper/DebugHelper.php | 12 +- .../com_users/src/Helper/UsersHelper.php | 8 +- .../com_users/src/Model/CaptiveModel.php | 4 +- .../com_users/src/Model/DebuggroupModel.php | 8 +- .../com_users/src/Model/DebuguserModel.php | 6 +- .../com_users/src/Model/GroupModel.php | 4 +- .../com_users/src/Model/GroupsModel.php | 2 +- .../com_users/src/Model/LevelsModel.php | 8 +- .../com_users/src/Model/MailModel.php | 8 +- .../com_users/src/Model/MethodModel.php | 2 +- .../com_users/src/Model/NotesModel.php | 2 +- .../com_users/src/Model/UserModel.php | 8 +- .../com_users/src/Model/UsersModel.php | 16 +- .../com_users/src/Service/HTML/Users.php | 16 +- .../com_users/src/Table/MfaTable.php | 2 +- .../com_users/src/Table/NoteTable.php | 2 +- .../com_users/src/View/Captive/HtmlView.php | 2 +- .../com_users/src/View/Methods/HtmlView.php | 4 +- .../com_workflow/services/provider.php | 3 +- .../src/Controller/StageController.php | 2 +- .../src/Controller/TransitionController.php | 2 +- .../src/Controller/WorkflowController.php | 10 +- .../src/Field/ComponentsWorkflowField.php | 6 +- .../com_workflow/src/Model/StageModel.php | 20 +- .../com_workflow/src/Model/StagesModel.php | 4 +- .../src/Model/TransitionModel.php | 16 +- .../src/Model/TransitionsModel.php | 6 +- .../com_workflow/src/Model/WorkflowModel.php | 18 +- .../com_workflow/src/Model/WorkflowsModel.php | 6 +- .../com_workflow/src/Table/StageTable.php | 4 +- .../src/Table/TransitionTable.php | 4 +- .../com_workflow/src/Table/WorkflowTable.php | 2 +- .../src/View/Transition/HtmlView.php | 2 +- .../com_wrapper/services/provider.php | 3 +- administrator/includes/framework.php | 2 +- .../modules/mod_latest/mod_latest.php | 4 +- administrator/modules/mod_menu/mod_menu.php | 4 +- .../modules/mod_menu/src/Menu/CssMenu.php | 8 +- .../modules/mod_popular/mod_popular.php | 6 +- .../src/Helper/PrivacyStatusHelper.php | 2 +- .../mod_quickicon/services/provider.php | 3 +- .../src/Helper/QuickIconHelper.php | 66 ++-- .../src/Helper/SampledataHelper.php | 2 +- .../modules/mod_submenu/mod_submenu.php | 2 +- administrator/templates/system/error.php | 8 +- .../src/Controller/CategoriesController.php | 2 +- .../src/Controller/ApplicationController.php | 4 +- .../src/Controller/ComponentController.php | 2 +- .../src/View/Application/JsonapiView.php | 24 +- .../src/View/Component/JsonapiView.php | 24 +- .../src/Controller/ContactController.php | 14 +- .../src/View/Articles/JsonapiView.php | 6 +- .../src/Controller/MediaController.php | 16 +- .../src/Controller/ItemsController.php | 8 +- .../com_menus/src/View/Items/JsonapiView.php | 24 +- .../src/View/Consents/JsonapiView.php | 2 +- .../src/View/Requests/JsonapiView.php | 2 +- .../src/Controller/StylesController.php | 2 +- .../com_users/src/View/Levels/JsonapiView.php | 2 +- build/build.php | 61 ++- build/bump.php | 2 +- build/convert_or_die.php | 4 +- build/deleted_file_check.php | 10 +- build/github_rebase.php | 54 +-- build/helpTOC.php | 6 +- build/psr12/convert_pull_requests.php | 1 - build/psr12/phpcs.joomla.report.php | 12 +- build/stubGenerator.php | 2 +- build/update_fido_cache.php | 14 +- cli/joomla.php | 2 +- components/com_ajax/ajax.php | 4 +- .../com_banners/src/Model/BannerModel.php | 6 +- .../com_banners/src/Model/BannersModel.php | 2 +- components/com_banners/src/Service/Router.php | 2 +- .../src/Controller/ModulesController.php | 2 +- .../com_config/src/Model/ModulesModel.php | 20 +- .../com_config/src/View/Config/HtmlView.php | 2 +- .../src/View/Templates/HtmlView.php | 2 +- .../com_contact/layouts/field/render.php | 2 +- .../src/Controller/ContactController.php | 18 +- .../src/Controller/DisplayController.php | 21 +- .../com_contact/src/Model/CategoriesModel.php | 10 +- .../com_contact/src/Model/CategoryModel.php | 24 +- .../com_contact/src/Model/ContactModel.php | 14 +- .../com_contact/src/Model/FeaturedModel.php | 6 +- components/com_contact/src/Service/Router.php | 8 +- .../src/View/Category/HtmlView.php | 4 +- .../com_contact/src/View/Contact/HtmlView.php | 12 +- .../com_contact/src/View/Contact/VcfView.php | 14 +- .../src/View/Featured/HtmlView.php | 6 +- .../src/Controller/ArticleController.php | 8 +- .../src/Controller/DisplayController.php | 32 +- .../com_content/src/Dispatcher/Dispatcher.php | 4 +- .../com_content/src/Helper/QueryHelper.php | 4 +- .../com_content/src/Model/ArchiveModel.php | 4 +- .../com_content/src/Model/ArticleModel.php | 10 +- .../com_content/src/Model/ArticlesModel.php | 12 +- .../com_content/src/Model/CategoriesModel.php | 10 +- .../com_content/src/Model/CategoryModel.php | 18 +- .../com_content/src/Model/FeaturedModel.php | 4 +- .../com_content/src/Model/FormModel.php | 6 +- components/com_content/src/Service/Router.php | 6 +- .../com_content/src/View/Archive/HtmlView.php | 16 +- .../com_content/src/View/Article/HtmlView.php | 10 +- .../src/View/Category/FeedView.php | 2 +- .../src/View/Category/HtmlView.php | 6 +- .../src/View/Featured/FeedView.php | 2 +- .../src/View/Featured/HtmlView.php | 6 +- .../com_content/src/View/Form/HtmlView.php | 6 +- .../src/Dispatcher/Dispatcher.php | 2 +- .../src/Controller/DisplayController.php | 4 +- .../src/Controller/SuggestionsController.php | 10 +- .../com_finder/src/Helper/FinderHelper.php | 16 +- .../com_finder/src/Helper/RouteHelper.php | 14 +- .../com_finder/src/Model/SearchModel.php | 24 +- .../com_finder/src/Model/SuggestionsModel.php | 10 +- .../com_finder/src/View/Search/FeedView.php | 8 +- .../com_finder/src/View/Search/HtmlView.php | 2 +- .../src/View/Search/OpensearchView.php | 6 +- .../layouts/joomla/searchtools/default.php | 2 +- .../com_menus/src/Dispatcher/Dispatcher.php | 2 +- .../com_modules/src/Dispatcher/Dispatcher.php | 2 +- .../src/Controller/DisplayController.php | 12 +- .../src/Model/CategoriesModel.php | 10 +- .../com_newsfeeds/src/Model/CategoryModel.php | 20 +- .../com_newsfeeds/src/Model/NewsfeedModel.php | 6 +- .../com_newsfeeds/src/Service/Category.php | 4 +- .../com_newsfeeds/src/Service/Router.php | 6 +- .../src/View/Category/HtmlView.php | 10 +- .../src/View/Newsfeed/HtmlView.php | 16 +- .../com_privacy/src/Model/ConfirmModel.php | 6 +- .../com_privacy/src/Model/RemindModel.php | 6 +- .../src/Controller/DisplayController.php | 2 +- .../com_tags/src/Helper/RouteHelper.php | 8 +- components/com_tags/src/Model/TagModel.php | 18 +- components/com_tags/src/Model/TagsModel.php | 4 +- components/com_tags/src/Service/Router.php | 10 +- components/com_tags/src/View/Tag/HtmlView.php | 4 +- .../com_tags/src/View/Tags/FeedView.php | 2 +- .../com_tags/src/View/Tags/HtmlView.php | 2 +- .../src/Controller/UserController.php | 12 +- .../com_users/src/Model/ProfileModel.php | 4 +- .../com_users/src/Model/RegistrationModel.php | 34 +- .../com_users/src/Model/RemindModel.php | 10 +- components/com_users/src/Model/ResetModel.php | 32 +- includes/framework.php | 2 +- installation/includes/app.php | 2 +- installation/includes/cli.php | 4 +- installation/includes/framework.php | 2 +- .../CliInstallationApplication.php | 2 +- .../Application/InstallationApplication.php | 10 +- installation/src/Console/InstallCommand.php | 2 +- .../src/Controller/InstallationController.php | 26 +- installation/src/Model/ChecksModel.php | 100 ++--- installation/src/Model/ConfigurationModel.php | 34 +- installation/src/Model/DatabaseModel.php | 2 +- installation/src/Model/LanguagesModel.php | 6 +- installation/src/Model/SetupModel.php | 4 +- installation/src/View/Remove/HtmlView.php | 6 +- installation/template/error.php | 8 +- installation/template/index.php | 4 +- libraries/src/Access/Access.php | 2 +- libraries/src/Access/Rule.php | 2 +- libraries/src/Adapter/Adapter.php | 8 +- .../Application/AdministratorApplication.php | 8 +- .../src/Application/ApplicationHelper.php | 34 +- libraries/src/Application/BaseApplication.php | 2 +- libraries/src/Application/CMSApplication.php | 14 +- .../src/Application/DaemonApplication.php | 16 +- .../MultiFactorAuthenticationHandler.php | 12 +- libraries/src/Application/SiteApplication.php | 18 +- libraries/src/Application/WebApplication.php | 2 +- .../AssociationExtensionHelper.php | 30 +- libraries/src/Button/ActionButton.php | 18 +- libraries/src/Button/FeaturedButton.php | 4 +- libraries/src/Button/PublishedButton.php | 10 +- libraries/src/Button/TransitionButton.php | 4 +- libraries/src/Cache/Cache.php | 8 +- libraries/src/Cache/CacheController.php | 2 +- libraries/src/Cache/CacheStorage.php | 2 +- libraries/src/Cache/Storage/ApcuStorage.php | 4 +- .../src/Cache/Storage/MemcachedStorage.php | 4 +- libraries/src/Captcha/Captcha.php | 10 +- libraries/src/Categories/Categories.php | 6 +- libraries/src/Categories/CategoryNode.php | 14 +- libraries/src/Changelog/Changelog.php | 4 +- libraries/src/Client/ClientHelper.php | 14 +- libraries/src/Client/FtpClient.php | 34 +- libraries/src/Component/ComponentHelper.php | 6 +- .../src/Component/Router/Rules/MenuRules.php | 4 +- .../Component/Router/Rules/NomenuRules.php | 6 +- libraries/src/Console/AddUserCommand.php | 16 +- .../src/Console/AddUserToGroupCommand.php | 2 +- .../src/Console/ChangeUserPasswordCommand.php | 4 +- .../src/Console/CheckJoomlaUpdatesCommand.php | 2 +- libraries/src/Console/DeleteUserCommand.php | 4 +- .../src/Console/ExtensionDiscoverCommand.php | 2 +- .../ExtensionDiscoverInstallCommand.php | 4 +- .../Console/ExtensionDiscoverListCommand.php | 2 +- .../src/Console/ExtensionInstallCommand.php | 6 +- .../src/Console/ExtensionRemoveCommand.php | 4 +- .../src/Console/ExtensionsListCommand.php | 7 +- libraries/src/Console/FinderIndexCommand.php | 6 +- .../src/Console/GetConfigurationCommand.php | 24 +- libraries/src/Console/ListUserCommand.php | 2 +- .../Console/RemoveUserFromGroupCommand.php | 4 +- .../src/Console/SetConfigurationCommand.php | 2 +- libraries/src/Console/TasksStateCommand.php | 4 +- libraries/src/Console/UpdateCoreCommand.php | 6 +- libraries/src/Date/Date.php | 4 +- .../Dispatcher/AbstractModuleDispatcher.php | 2 +- .../src/Dispatcher/ComponentDispatcher.php | 2 +- libraries/src/Document/FeedDocument.php | 2 +- libraries/src/Document/HtmlDocument.php | 56 +-- libraries/src/Document/OpensearchDocument.php | 16 +- .../Document/Renderer/Feed/AtomRenderer.php | 2 +- .../Document/Renderer/Feed/RssRenderer.php | 2 +- .../Document/Renderer/Html/MetasRenderer.php | 4 +- .../Document/Renderer/Html/ModuleRenderer.php | 22 +- .../Renderer/Html/ScriptsRenderer.php | 2 +- .../Document/Renderer/Html/StylesRenderer.php | 2 +- libraries/src/Editor/Editor.php | 22 +- libraries/src/Encrypt/AES/OpenSSL.php | 4 +- libraries/src/Encrypt/Base32.php | 6 +- libraries/src/Encrypt/Totp.php | 10 +- libraries/src/Environment/Browser.php | 2 +- .../AuthenticationFailedExceptionHandler.php | 2 +- .../InvalidParameterExceptionHandler.php | 2 +- .../JsonApi/InvalidRouteExceptionHandler.php | 2 +- .../JsonApi/NotAcceptableExceptionHandler.php | 2 +- .../JsonApi/NotAllowedExceptionHandler.php | 2 +- .../ResourceNotFoundExceptionHandler.php | 2 +- .../Error/JsonApi/SaveExceptionHandler.php | 2 +- .../src/Error/Renderer/JsonapiRenderer.php | 2 +- libraries/src/Event/AbstractEvent.php | 4 +- libraries/src/Event/CoreEventAware.php | 72 ++-- .../Plugin/System/Webauthn/AjaxInitCreate.php | 2 +- libraries/src/Extension/ExtensionHelper.php | 2 +- .../src/Extension/ExtensionManagerTrait.php | 4 +- libraries/src/Extension/LegacyComponent.php | 2 +- libraries/src/Factory.php | 36 +- libraries/src/Feed/Feed.php | 10 +- libraries/src/Feed/FeedEntry.php | 12 +- libraries/src/Feed/FeedLink.php | 6 +- libraries/src/Feed/FeedPerson.php | 6 +- libraries/src/Feed/Parser/AtomParser.php | 2 +- libraries/src/Feed/Parser/RssParser.php | 6 +- libraries/src/Filesystem/File.php | 16 +- libraries/src/Filesystem/FilesystemHelper.php | 18 +- libraries/src/Filesystem/Folder.php | 26 +- libraries/src/Filesystem/Patcher.php | 14 +- libraries/src/Filesystem/Stream.php | 24 +- .../src/Filesystem/Streams/StreamString.php | 32 +- .../Filesystem/Support/StringController.php | 2 +- libraries/src/Filter/InputFilter.php | 16 +- libraries/src/Filter/OutputFilter.php | 4 +- .../src/Form/Field/AccessiblemediaField.php | 6 +- libraries/src/Form/Field/CalendarField.php | 2 +- libraries/src/Form/Field/CategoryField.php | 2 +- libraries/src/Form/Field/CheckboxField.php | 4 +- libraries/src/Form/Field/ChromestyleField.php | 8 +- .../src/Form/Field/ComponentlayoutField.php | 22 +- .../src/Form/Field/ContenthistoryField.php | 4 +- libraries/src/Form/Field/ContenttypeField.php | 4 +- libraries/src/Form/Field/EditorField.php | 2 +- libraries/src/Form/Field/EmailField.php | 4 +- libraries/src/Form/Field/FilelistField.php | 2 +- libraries/src/Form/Field/FolderlistField.php | 2 +- libraries/src/Form/Field/GroupedlistField.php | 2 +- libraries/src/Form/Field/HeadertagField.php | 4 +- libraries/src/Form/Field/IntegerField.php | 4 +- libraries/src/Form/Field/LanguageField.php | 2 +- libraries/src/Form/Field/LimitboxField.php | 4 +- libraries/src/Form/Field/MenuitemField.php | 2 +- libraries/src/Form/Field/MeterField.php | 4 +- .../src/Form/Field/ModulelayoutField.php | 20 +- libraries/src/Form/Field/ModuleorderField.php | 2 +- .../src/Form/Field/ModulepositionField.php | 20 +- libraries/src/Form/Field/ModuletagField.php | 2 +- libraries/src/Form/Field/PasswordField.php | 22 +- .../src/Form/Field/PluginstatusField.php | 4 +- libraries/src/Form/Field/RadiobasicField.php | 2 +- libraries/src/Form/Field/RangeField.php | 4 +- libraries/src/Form/Field/RulesField.php | 6 +- libraries/src/Form/Field/SpacerField.php | 4 +- libraries/src/Form/Field/SqlField.php | 2 +- libraries/src/Form/Field/SubformField.php | 22 +- libraries/src/Form/Field/TagField.php | 4 +- .../src/Form/Field/TemplatestyleField.php | 6 +- libraries/src/Form/Field/TextField.php | 12 +- libraries/src/Form/Field/TextareaField.php | 8 +- libraries/src/Form/Field/TimezoneField.php | 2 +- libraries/src/Form/Field/TransitionField.php | 7 +- libraries/src/Form/Field/UserField.php | 6 +- libraries/src/Form/Field/UseractiveField.php | 4 +- libraries/src/Form/Field/UserstateField.php | 4 +- libraries/src/Form/Filter/TelFilter.php | 10 +- libraries/src/Form/Form.php | 40 +- libraries/src/Form/FormField.php | 26 +- libraries/src/Form/FormHelper.php | 2 +- libraries/src/Form/Rule/PasswordRule.php | 14 +- libraries/src/Form/Rule/RulesRule.php | 2 +- libraries/src/Form/Rule/TelRule.php | 6 +- libraries/src/Form/Rule/UrlRule.php | 2 +- libraries/src/HTML/HTMLHelper.php | 10 +- libraries/src/HTML/Helpers/Access.php | 18 +- .../src/HTML/Helpers/ActionsDropdown.php | 2 +- libraries/src/HTML/Helpers/Behavior.php | 10 +- libraries/src/HTML/Helpers/Bootstrap.php | 28 +- libraries/src/HTML/Helpers/Category.php | 10 +- libraries/src/HTML/Helpers/Content.php | 2 +- libraries/src/HTML/Helpers/Dropdown.php | 6 +- libraries/src/HTML/Helpers/Grid.php | 16 +- libraries/src/HTML/Helpers/JGrid.php | 82 ++-- libraries/src/HTML/Helpers/Links.php | 2 +- libraries/src/HTML/Helpers/ListHelper.php | 18 +- libraries/src/HTML/Helpers/Menu.php | 14 +- libraries/src/HTML/Helpers/SearchTools.php | 4 +- libraries/src/HTML/Helpers/Select.php | 99 +++-- libraries/src/HTML/Helpers/StringHelper.php | 10 +- libraries/src/HTML/Helpers/Tag.php | 22 +- libraries/src/HTML/Helpers/Telephone.php | 8 +- libraries/src/HTML/Helpers/UiTab.php | 4 +- libraries/src/HTML/Helpers/User.php | 4 +- libraries/src/HTML/Helpers/WorkflowStage.php | 2 +- libraries/src/Helper/CMSHelper.php | 12 +- libraries/src/Helper/ContentHelper.php | 2 +- libraries/src/Helper/LibraryHelper.php | 6 +- libraries/src/Helper/MediaHelper.php | 2 +- libraries/src/Helper/ModuleHelper.php | 42 +- libraries/src/Helper/RouteHelper.php | 6 +- libraries/src/Helper/TagsHelper.php | 62 +-- libraries/src/Helper/UserGroupsHelper.php | 4 +- libraries/src/Http/HttpFactory.php | 4 +- .../src/Http/Transport/CurlTransport.php | 4 +- .../src/Http/Transport/SocketTransport.php | 4 +- .../src/Http/Transport/StreamTransport.php | 4 +- libraries/src/Image/Image.php | 28 +- libraries/src/Input/Cli.php | 19 +- .../Installer/Adapter/ComponentAdapter.php | 42 +- .../src/Installer/Adapter/FileAdapter.php | 30 +- .../src/Installer/Adapter/LanguageAdapter.php | 10 +- .../src/Installer/Adapter/LibraryAdapter.php | 8 +- .../src/Installer/Adapter/ModuleAdapter.php | 40 +- .../src/Installer/Adapter/PackageAdapter.php | 28 +- .../src/Installer/Adapter/PluginAdapter.php | 18 +- .../src/Installer/Adapter/TemplateAdapter.php | 14 +- libraries/src/Installer/Installer.php | 70 ++-- .../src/Installer/InstallerExtension.php | 4 +- libraries/src/Installer/InstallerHelper.php | 8 +- libraries/src/Installer/InstallerScript.php | 4 +- libraries/src/Language/Associations.php | 2 +- libraries/src/Language/Language.php | 42 +- libraries/src/Language/LanguageHelper.php | 22 +- libraries/src/Language/Multilanguage.php | 2 +- libraries/src/Language/Text.php | 16 +- libraries/src/Layout/FileLayout.php | 6 +- libraries/src/Layout/LayoutHelper.php | 4 +- libraries/src/Log/DelegatingPsrLogger.php | 2 +- libraries/src/Log/Log.php | 6 +- libraries/src/Log/Logger/DatabaseLogger.php | 28 +- .../src/Log/Logger/FormattedtextLogger.php | 6 +- libraries/src/Log/Logger/SyslogLogger.php | 14 +- .../src/MVC/Controller/AdminController.php | 6 +- .../src/MVC/Controller/BaseController.php | 32 +- .../src/MVC/Controller/FormController.php | 26 +- libraries/src/MVC/Model/AdminModel.php | 38 +- libraries/src/MVC/Model/BaseDatabaseModel.php | 2 +- libraries/src/MVC/Model/ListModel.php | 5 +- .../src/MVC/Model/WorkflowBehaviorTrait.php | 2 +- libraries/src/MVC/View/AbstractView.php | 2 +- libraries/src/MVC/View/CategoryFeedView.php | 12 +- libraries/src/MVC/View/CategoryView.php | 2 +- libraries/src/MVC/View/FormView.php | 2 +- libraries/src/MVC/View/HtmlView.php | 16 +- libraries/src/MVC/View/JsonApiView.php | 30 +- libraries/src/MVC/View/ListView.php | 4 +- libraries/src/Mail/Mail.php | 6 +- libraries/src/Mail/MailHelper.php | 8 +- libraries/src/Mail/MailTemplate.php | 68 ++-- libraries/src/Microdata/Microdata.php | 6 +- .../src/Object/LegacyErrorHandlingTrait.php | 2 +- .../Object/LegacyPropertyManagementTrait.php | 2 +- libraries/src/Pagination/Pagination.php | 16 +- libraries/src/Pathway/Pathway.php | 4 +- libraries/src/Plugin/CMSPlugin.php | 6 +- libraries/src/Plugin/PluginHelper.php | 10 +- libraries/src/Profiler/Profiler.php | 20 +- libraries/src/Response/JsonResponse.php | 2 +- libraries/src/Router/ApiRouter.php | 2 +- libraries/src/Router/Router.php | 8 +- libraries/src/Router/SiteRouter.php | 10 +- libraries/src/Schema/ChangeItem.php | 4 +- .../src/Schema/ChangeItem/MysqlChangeItem.php | 48 +-- .../ChangeItem/PostgresqlChangeItem.php | 74 ++-- .../Schema/ChangeItem/SqlsrvChangeItem.php | 28 +- libraries/src/Schema/ChangeSet.php | 10 +- libraries/src/Serializer/JoomlaSerializer.php | 2 +- libraries/src/Session/MetadataManager.php | 2 +- .../src/Session/Storage/JoomlaStorage.php | 4 +- libraries/src/String/PunycodeHelper.php | 20 +- libraries/src/Table/Category.php | 4 +- libraries/src/Table/Content.php | 14 +- libraries/src/Table/ContentHistory.php | 6 +- libraries/src/Table/ContentType.php | 4 +- libraries/src/Table/CoreContent.php | 10 +- libraries/src/Table/Menu.php | 8 +- libraries/src/Table/MenuType.php | 4 +- libraries/src/Table/Module.php | 6 +- libraries/src/Table/Nested.php | 96 ++--- libraries/src/Table/Table.php | 130 +++---- libraries/src/Table/User.php | 8 +- libraries/src/Table/ViewLevel.php | 2 +- .../src/Toolbar/Button/ConfirmButton.php | 4 +- .../src/Toolbar/Button/DropdownButton.php | 12 +- .../src/Toolbar/Button/InlinehelpButton.php | 8 +- libraries/src/Toolbar/Button/LinkButton.php | 2 +- libraries/src/Toolbar/Button/PopupButton.php | 2 +- .../src/Toolbar/Button/StandardButton.php | 4 +- libraries/src/Toolbar/CoreButtonsTrait.php | 4 +- libraries/src/Toolbar/ToolbarButton.php | 16 +- libraries/src/Toolbar/ToolbarHelper.php | 12 +- libraries/src/Tree/ImmutableNodeTrait.php | 2 +- libraries/src/Tree/NodeTrait.php | 2 +- libraries/src/UCM/UCMBase.php | 6 +- libraries/src/UCM/UCMContent.php | 4 +- libraries/src/UCM/UCMType.php | 2 +- .../src/Updater/Adapter/ExtensionAdapter.php | 12 +- libraries/src/Updater/Update.php | 8 +- libraries/src/Updater/UpdateAdapter.php | 12 +- libraries/src/Updater/Updater.php | 4 +- libraries/src/Uri/Uri.php | 22 +- libraries/src/User/User.php | 22 +- libraries/src/User/UserHelper.php | 40 +- libraries/src/Utility/BufferStreamHandler.php | 10 +- libraries/src/Utility/Utility.php | 2 +- .../Versioning/VersionableControllerTrait.php | 4 +- libraries/src/Versioning/Versioning.php | 12 +- .../src/WebAsset/AssetItem/CoreAssetItem.php | 4 +- libraries/src/WebAsset/WebAssetManager.php | 8 +- libraries/src/WebAsset/WebAssetRegistry.php | 6 +- libraries/src/Workflow/Workflow.php | 14 +- .../src/Workflow/WorkflowPluginTrait.php | 2 +- .../src/Workflow/WorkflowServiceTrait.php | 2 +- .../mod_articles_latest/services/provider.php | 3 +- .../mod_articles_news/services/provider.php | 3 +- .../src/Helper/ArticlesNewsHelper.php | 6 +- .../services/provider.php | 3 +- modules/mod_finder/mod_finder.php | 2 +- .../mod_finder/src/Helper/FinderHelper.php | 4 +- .../src/Helper/LanguagesHelper.php | 6 +- modules/mod_login/src/Helper/LoginHelper.php | 2 +- .../src/Helper/RelatedItemsHelper.php | 2 +- modules/mod_stats/src/Helper/StatsHelper.php | 18 +- modules/mod_tags_popular/mod_tags_popular.php | 10 +- modules/mod_tags_similar/mod_tags_similar.php | 10 +- .../actionlog/joomla/services/provider.php | 3 +- .../actionlog/joomla/src/Extension/Joomla.php | 38 +- .../basic/services/provider.php | 3 +- .../token/services/provider.php | 3 +- .../cookie/services/provider.php | 3 +- .../joomla/services/provider.php | 3 +- .../authentication/ldap/services/provider.php | 3 +- .../ldap/src/Extension/Ldap.php | 28 +- .../behaviour/taggable/services/provider.php | 3 +- .../taggable/src/Extension/Taggable.php | 8 +- .../versionable/services/provider.php | 3 +- .../versionable/src/Extension/Versionable.php | 8 +- .../recaptcha_invisible.php | 2 +- .../confirmconsent/services/provider.php | 3 +- .../src/Field/ConsentBoxField.php | 22 +- plugins/content/contact/services/provider.php | 3 +- .../content/emailcloak/services/provider.php | 3 +- .../emailcloak/src/Extension/EmailCloak.php | 102 ++--- plugins/content/fields/services/provider.php | 3 +- plugins/content/joomla/joomla.php | 27 +- plugins/content/loadmodule/loadmodule.php | 26 +- plugins/content/pagebreak/pagebreak.php | 4 +- .../content/pagenavigation/pagenavigation.php | 8 +- .../editors-xtd/article/services/provider.php | 3 +- .../article/src/Extension/Article.php | 4 +- .../editors-xtd/contact/services/provider.php | 3 +- .../contact/src/Extension/Contact.php | 10 +- .../editors-xtd/fields/services/provider.php | 3 +- .../fields/src/Extension/Fields.php | 4 +- .../editors-xtd/image/services/provider.php | 3 +- .../editors-xtd/image/src/Extension/Image.php | 4 +- .../editors-xtd/menu/services/provider.php | 3 +- .../editors-xtd/menu/src/Extension/Menu.php | 10 +- .../editors-xtd/module/services/provider.php | 3 +- .../module/src/Extension/Module.php | 2 +- plugins/editors-xtd/pagebreak/pagebreak.php | 4 +- .../readmore/services/provider.php | 3 +- .../readmore/src/Extension/ReadMore.php | 2 +- .../layouts/editors/codemirror/styles.php | 2 +- .../editors/codemirror/services/provider.php | 3 +- .../codemirror/src/Extension/Codemirror.php | 10 +- .../codemirror/src/Field/FontsField.php | 2 +- plugins/editors/none/services/provider.php | 3 +- plugins/editors/none/src/Extension/None.php | 2 +- plugins/editors/tinymce/services/provider.php | 3 +- .../tinymce/src/PluginTraits/DisplayTrait.php | 54 +-- .../tinymce/src/PluginTraits/KnownButtons.php | 50 +-- .../src/PluginTraits/ToolbarPresets.php | 2 +- .../tinymce/src/PluginTraits/XTDButtons.php | 2 +- .../extension/finder/services/provider.php | 3 +- .../extension/finder/src/Extension/Finder.php | 4 +- .../extension/joomla/services/provider.php | 3 +- .../extension/joomla/src/Extension/Joomla.php | 4 +- .../namespacemap/services/provider.php | 3 +- plugins/fields/subform/subform.php | 2 +- plugins/filesystem/local/local.php | 2 +- .../local/src/Adapter/LocalAdapter.php | 8 +- plugins/finder/categories/categories.php | 2 +- plugins/finder/contacts/contacts.php | 2 +- plugins/finder/content/content.php | 4 +- plugins/finder/newsfeeds/newsfeeds.php | 2 +- plugins/finder/tags/tags.php | 2 +- plugins/installer/override/override.php | 4 +- .../email/services/provider.php | 3 +- .../email/src/Extension/Email.php | 36 +- .../fixed/services/provider.php | 3 +- .../fixed/src/Extension/Fixed.php | 12 +- .../totp/services/provider.php | 3 +- .../totp/src/Extension/Totp.php | 40 +- .../webauthn/services/provider.php | 3 +- .../webauthn/src/CredentialRepository.php | 2 +- .../webauthn/src/Extension/Webauthn.php | 2 +- .../AndroidKeyAttestationStatementSupport.php | 8 +- .../FidoU2FAttestationStatementSupport.php | 6 +- .../webauthn/src/Hotfix/Server.php | 16 +- .../yubikey/services/provider.php | 3 +- .../yubikey/src/Extension/Yubikey.php | 14 +- plugins/privacy/user/user.php | 10 +- .../downloadkey/services/provider.php | 3 +- .../extensionupdate/services/provider.php | 3 +- .../src/Extension/Extensionupdate.php | 2 +- .../joomlaupdate/services/provider.php | 3 +- .../overridecheck/services/provider.php | 3 +- .../phpversioncheck/services/provider.php | 3 +- .../privacycheck/services/provider.php | 3 +- plugins/sampledata/blog/blog.php | 362 +++++++++--------- plugins/sampledata/multilang/multilang.php | 19 +- plugins/sampledata/testing/testing.php | 168 ++++---- .../system/accessibility/accessibility.php | 4 +- plugins/system/actionlogs/actionlogs.php | 2 +- plugins/system/cache/services/provider.php | 3 +- plugins/system/cache/src/Extension/Cache.php | 2 +- plugins/system/debug/debug.php | 18 +- .../debug/src/DataCollector/InfoCollector.php | 36 +- .../DataCollector/LanguageErrorsCollector.php | 12 +- .../DataCollector/LanguageFilesCollector.php | 16 +- .../LanguageStringsCollector.php | 2 +- .../src/DataCollector/ProfileCollector.php | 6 +- .../src/DataCollector/QueryCollector.php | 8 +- .../DataCollector/RequestDataCollector.php | 2 +- .../src/DataCollector/SessionCollector.php | 8 +- .../system/debug/src/JavascriptRenderer.php | 4 +- .../system/debug/src/Storage/FileStorage.php | 8 +- plugins/system/fields/fields.php | 6 +- plugins/system/highlight/highlight.php | 4 +- plugins/system/httpheaders/httpheaders.php | 4 +- plugins/system/languagecode/languagecode.php | 6 +- .../system/languagefilter/languagefilter.php | 14 +- .../system/privacyconsent/privacyconsent.php | 8 +- .../privacyconsent/src/Field/PrivacyField.php | 24 +- plugins/system/redirect/redirect.php | 12 +- .../system/schedulerunner/schedulerunner.php | 18 +- plugins/system/sef/sef.php | 4 +- plugins/system/shortcut/services/provider.php | 3 +- .../updatenotification/updatenotification.php | 2 +- plugins/system/webauthn/services/provider.php | 3 +- .../system/webauthn/src/Authentication.php | 2 +- .../webauthn/src/CredentialRepository.php | 6 +- .../webauthn/src/Field/WebauthnField.php | 2 +- .../AndroidKeyAttestationStatementSupport.php | 8 +- .../FidoU2FAttestationStatementSupport.php | 6 +- plugins/system/webauthn/src/Hotfix/Server.php | 16 +- .../src/PluginTraits/AjaxHandlerCreate.php | 4 +- plugins/task/checkfiles/services/provider.php | 3 +- plugins/task/demotasks/services/provider.php | 3 +- .../demotasks/src/Extension/DemoTasks.php | 4 +- plugins/task/requests/services/provider.php | 3 +- .../task/requests/src/Extension/Requests.php | 2 +- plugins/task/sitestatus/services/provider.php | 3 +- .../sitestatus/src/Extension/SiteStatus.php | 4 +- plugins/user/joomla/joomla.php | 16 +- plugins/user/profile/profile.php | 6 +- plugins/user/profile/src/Field/TosField.php | 16 +- plugins/user/terms/src/Field/TermsField.php | 4 +- plugins/webservices/contact/contact.php | 2 +- plugins/workflow/featuring/featuring.php | 14 +- .../workflow/notification/notification.php | 18 +- plugins/workflow/publishing/publishing.php | 2 +- templates/system/error.php | 8 +- tests/Codeception/_support/Helper/Api.php | 4 +- .../components/com_media/MediaListCest.php | 8 +- .../api/com_banners/BannerCest.php | 20 +- .../api/com_contact/ContactCest.php | 14 +- .../api/com_content/ContentCest.php | 17 +- tests/Codeception/api/com_media/MediaCest.php | 10 +- tests/Integration/DBTestHelper.php | 10 +- .../Libraries/Cms/Table/TableTest.php | 62 +-- .../Authentication/Ldap/LdapPluginTest.php | 52 +-- .../Model/ActionlogConfigModelTest.php | 2 +- tests/Unit/Libraries/Cms/Access/RuleTest.php | 28 +- tests/Unit/Libraries/Cms/Access/RulesTest.php | 106 ++--- .../Application/ConsoleApplicationTest.php | 10 +- .../CacheControllerFactoryAwareTraitTest.php | 3 +- .../ExtensionDiscoverInstallCommandTest.php | 4 +- .../ExtensionDiscoverListCommandTest.php | 6 +- .../Libraries/Cms/Document/DocumentTest.php | 52 +-- .../Unit/Libraries/Cms/Feed/FeedEntryTest.php | 30 +- .../Libraries/Cms/Feed/FeedFactoryTest.php | 10 +- .../Libraries/Cms/Feed/FeedParserTest.php | 44 +-- tests/Unit/Libraries/Cms/Feed/FeedTest.php | 26 +- .../Cms/Feed/Parser/AtomParserTest.php | 66 ++-- .../Cms/Feed/Parser/RssParserTest.php | 112 +++--- .../Form/Field/AccessiblemediaFieldTest.php | 40 +- .../Unit/Libraries/Cms/Html/JHtmlDateTest.php | 12 +- .../Libraries/Cms/Html/JHtmlNumberTest.php | 26 +- .../Libraries/Cms/Html/JHtmlStringTest.php | 52 +-- .../Image/Filter/FilterBackgroundfillTest.php | 14 +- .../Cms/Image/Filter/FilterContrastTest.php | 2 +- .../Cms/Image/Filter/FilterEdgedetectTest.php | 2 +- tests/Unit/Libraries/Cms/Image/ImageTest.php | 12 +- .../Cms/MVC/Controller/BaseControllerTest.php | 284 +++----------- .../Libraries/Cms/MVC/Model/BaseModelTest.php | 15 +- .../Cms/MVC/Model/DatabaseModelTest.php | 49 +-- .../Libraries/Cms/MVC/Model/FormModelTest.php | 48 +-- .../Libraries/Cms/MVC/Model/ItemModelTest.php | 12 +- .../Cms/MVC/Model/StateBehaviorTraitTest.php | 18 +- .../Cms/MVC/View/AbstractViewTest.php | 42 +- .../Libraries/Cms/Mail/MailHelperTest.php | 6 +- tests/Unit/Libraries/Cms/Mail/MailTest.php | 32 +- .../Libraries/Cms/Microdata/MicrodataTest.php | 210 +++++----- .../Libraries/Cms/Object/CMSObjectTest.php | 11 +- .../Libraries/Cms/Plugin/CMSPluginTest.php | 66 ++-- .../Cms/Toolbar/Button/CustomButtonTest.php | 2 +- .../Libraries/Cms/Toolbar/ToolbarTest.php | 6 +- tests/Unit/Libraries/Cms/Uri/UriTest.php | 17 +- .../Cms/User/CurrentUserTraitTest.php | 3 +- .../Authentication/Ldap/LdapPluginTest.php | 12 +- .../Extension/CheckfilesPluginTest.php | 8 +- .../Requests/Extension/RequestsPluginTest.php | 35 +- tests/Unit/UnitTestCase.php | 3 +- 911 files changed, 5260 insertions(+), 5612 deletions(-) diff --git a/.drone.yml b/.drone.yml index a75913ff3bab6..e7afa44165c84 100644 --- a/.drone.yml +++ b/.drone.yml @@ -27,6 +27,7 @@ steps: depends_on: [ composer ] commands: - echo $(date) + - ./libraries/vendor/bin/php-cs-fixer fix -vvv --dry-run - ./libraries/vendor/bin/phpcs --extensions=php -p --standard=ruleset.xml . - echo $(date) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 67e4aee1f962a..69c9a61acd05a 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -29,18 +29,8 @@ * ./libraries/vendor/bin/php-cs-fixer fix administrator/index.php */ -// Only index the files in /libraries and no deeper, to prevent /libraries/vendor being indexed -$topFilesFinder = PhpCsFixer\Finder::create() - ->in( - [ - __DIR__ . '/libraries' - ] - ) - ->files() - ->depth(0); - -// Add all the core Joomla folders and append to this list the files indexed above from /libraries -$mainFinder = PhpCsFixer\Finder::create() +// Add all the core Joomla folders +$finder = PhpCsFixer\Finder::create() ->in( [ __DIR__ . '/administrator', @@ -57,20 +47,39 @@ __DIR__ . '/plugins', __DIR__ . '/templates', __DIR__ . '/tests', - __DIR__ . '/layouts', ] ) - ->append($topFilesFinder); + // Ignore template files as PHP CS fixer can't handle them properly + // https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/3702#issuecomment-396717120 + ->notPath('/tmpl/') + ->notPath('/layouts/') + ->notPath('/cassiopeia/') + ->notPath('/atum/') + // Ignore psr12 scripts because they contain invalid syntax + ->notPath('/psr12/') + ->notName('github_rebase.php'); $config = new PhpCsFixer\Config(); $config ->setRiskyAllowed(true) + ->setHideProgress(false) + ->setUsingCache(false) ->setRules( [ - '@PSR12' => true, - 'array_syntax' => ['syntax' => 'short'], + // Basic ruleset is PSR 12 + '@PSR12' => true, + // Short array syntax + 'array_syntax' => ['syntax' => 'short'], + // Lists should not have a trailing comma like list($foo, $bar,) = ... + 'no_trailing_comma_in_list_call' => true, + // Arrays on multiline should have a trailing comma + 'trailing_comma_in_multiline' => ['elements' => ['arrays']], + // Align elements in multiline array and variable declarations on new lines below each other + 'binary_operator_spaces' => ['operators' => ['=>' => 'align_single_space_minimal', '=' => 'align']], + // The "No break" comment in switch statements + 'no_break_comment' => ['comment_text' => 'No break'], ] ) - ->setFinder($mainFinder); + ->setFinder($finder); return $config; diff --git a/administrator/components/com_actionlogs/services/provider.php b/administrator/components/com_actionlogs/services/provider.php index 3d81708bd9fe0..6f6c54d9c4bc4 100644 --- a/administrator/components/com_actionlogs/services/provider.php +++ b/administrator/components/com_actionlogs/services/provider.php @@ -24,8 +24,7 @@ * * @since 4.0.0 */ -return new class implements ServiceProviderInterface -{ +return new class () implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * diff --git a/administrator/components/com_actionlogs/src/Field/LogtypeField.php b/administrator/components/com_actionlogs/src/Field/LogtypeField.php index b3ae4c96ef186..d55071386192f 100644 --- a/administrator/components/com_actionlogs/src/Field/LogtypeField.php +++ b/administrator/components/com_actionlogs/src/Field/LogtypeField.php @@ -55,7 +55,7 @@ public function getOptions() foreach ($extensions as $extension) { ActionlogsHelper::loadTranslationFiles($extension); - $extensionName = Text::_($extension); + $extensionName = Text::_($extension); $options[ApplicationHelper::stringURLSafe($extensionName) . '_' . $extension] = HTMLHelper::_('select.option', $extension, $extensionName); } diff --git a/administrator/components/com_actionlogs/src/Helper/ActionlogsHelper.php b/administrator/components/com_actionlogs/src/Helper/ActionlogsHelper.php index af6254ef0bab5..0fc9ca67b0eb1 100644 --- a/administrator/components/com_actionlogs/src/Helper/ActionlogsHelper.php +++ b/administrator/components/com_actionlogs/src/Helper/ActionlogsHelper.php @@ -78,7 +78,7 @@ public static function getCsvData($data): Generator '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) + 'ip_address' => self::escapeCsvFormula($log->ip_address === 'COM_ACTIONLOGS_DISABLED' ? $disabledText : $log->ip_address), ]; } } @@ -95,7 +95,7 @@ public static function getCsvData($data): Generator public static function loadTranslationFiles($extension) { static $cache = []; - $extension = strtolower($extension); + $extension = strtolower($extension); if (isset($cache[$extension])) { return; @@ -277,13 +277,13 @@ public static function loadActionLogPluginsLanguage() 'folder', 'element', 'params', - 'extension_id' + 'extension_id', ], [ 'type', 'name', 'params', - 'id' + 'id', ] ) ) diff --git a/administrator/components/com_actionlogs/src/Model/ActionlogModel.php b/administrator/components/com_actionlogs/src/Model/ActionlogModel.php index b0edc5b45d83b..fbf7acd1f4ac2 100644 --- a/administrator/components/com_actionlogs/src/Model/ActionlogModel.php +++ b/administrator/components/com_actionlogs/src/Model/ActionlogModel.php @@ -145,16 +145,16 @@ protected function sendNotificationEmails($messages, $username, $context) $temp = []; foreach ($messages as $message) { - $m = []; + $m = []; $m['extension'] = Text::_($extension); $m['message'] = ActionlogsHelper::getHumanReadableLogMessage($message); $m['date'] = HTMLHelper::_('date', $message->log_date, 'Y-m-d H:i:s T', 'UTC'); $m['username'] = $username; - $temp[] = $m; + $temp[] = $m; } $templateData = [ - 'messages' => $temp + 'messages' => $temp, ]; $mailer = new MailTemplate('com_actionlogs.notification', $app->getLanguage()->getTag()); diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index 0c574e3d90eda..bd51061c51e15 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -307,10 +307,10 @@ protected function uninstallRepeatableFieldsPlugin() * for each of the sub fields of the `repeatable` instance. */ $data = [ - 'context' => $row->context, - 'group_id' => $row->group_id, - 'title' => $oldField->fieldname, - 'name' => ( + 'context' => $row->context, + 'group_id' => $row->group_id, + 'title' => $oldField->fieldname, + 'name' => ( $fieldname_prefix . $oldField->fieldname . ($fieldname_suffix > 0 ? ('_' . $fieldname_suffix) : '') @@ -7886,7 +7886,7 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false) '/libraries/vendor/paragonie/sodium_compat/dist', ]; - $status['files_checked'] = $files; + $status['files_checked'] = $files; $status['folders_checked'] = $folders; foreach ($files as $file) { @@ -8351,7 +8351,7 @@ private function contactItems(Table $tableItem): array 'client_id' => 1, 'publish_up' => null, 'publish_down' => null, - ] + ], ]; return $menuItems; @@ -8510,7 +8510,7 @@ private function finderItems(Table $tableItem): array 'client_id' => 1, 'publish_up' => null, 'publish_down' => null, - ] + ], ]; return $menuItems; @@ -8543,7 +8543,7 @@ private function updateContentTypes(): void ]; // Get table definitions. - $db = Factory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true) ->select( [ @@ -8612,7 +8612,7 @@ protected function fixFilenameCasing() $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', + '/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', ]; @@ -8668,14 +8668,14 @@ protected function fixFilenameCasing() protected function moveRemainingTemplateFiles() { $folders = [ - '/administrator/templates/atum/css' => '/media/templates/administrator/atum/css', + '/administrator/templates/atum/css' => '/media/templates/administrator/atum/css', '/administrator/templates/atum/images' => '/media/templates/administrator/atum/images', - '/administrator/templates/atum/js' => '/media/templates/administrator/atum/js', - '/administrator/templates/atum/scss' => '/media/templates/administrator/atum/scss', - '/templates/cassiopeia/css' => '/media/templates/site/cassiopeia/css', - '/templates/cassiopeia/images' => '/media/templates/site/cassiopeia/images', - '/templates/cassiopeia/js' => '/media/templates/site/cassiopeia/js', - '/templates/cassiopeia/scss' => '/media/templates/site/cassiopeia/scss', + '/administrator/templates/atum/js' => '/media/templates/administrator/atum/js', + '/administrator/templates/atum/scss' => '/media/templates/administrator/atum/scss', + '/templates/cassiopeia/css' => '/media/templates/site/cassiopeia/css', + '/templates/cassiopeia/images' => '/media/templates/site/cassiopeia/images', + '/templates/cassiopeia/js' => '/media/templates/site/cassiopeia/js', + '/templates/cassiopeia/scss' => '/media/templates/site/cassiopeia/scss', ]; foreach ($folders as $oldFolder => $newFolder) { diff --git a/administrator/components/com_admin/services/provider.php b/administrator/components/com_admin/services/provider.php index d17a3d0cc5faf..33f2e97838907 100644 --- a/administrator/components/com_admin/services/provider.php +++ b/administrator/components/com_admin/services/provider.php @@ -25,8 +25,7 @@ * * @since 4.0.0 */ -return new class implements ServiceProviderInterface -{ +return new class () implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * diff --git a/administrator/components/com_admin/src/Model/HelpModel.php b/administrator/components/com_admin/src/Model/HelpModel.php index 7572d9b7aadf9..e93a2384f4750 100644 --- a/administrator/components/com_admin/src/Model/HelpModel.php +++ b/administrator/components/com_admin/src/Model/HelpModel.php @@ -152,7 +152,7 @@ public function &getToc() } // Get Help files - $files = Folder::files(JPATH_BASE . '/help/' . $lang_tag, '\.xml$|\.html$'); + $files = Folder::files(JPATH_BASE . '/help/' . $lang_tag, '\.xml$|\.html$'); $this->toc = []; foreach ($files as $file) { diff --git a/administrator/components/com_admin/src/Model/SysinfoModel.php b/administrator/components/com_admin/src/Model/SysinfoModel.php index 80425291ed743..0fa96f5ede7db 100644 --- a/administrator/components/com_admin/src/Model/SysinfoModel.php +++ b/administrator/components/com_admin/src/Model/SysinfoModel.php @@ -140,7 +140,7 @@ class SysinfoModel extends BaseDatabaseModel 'smtphost', 'tmp_path', 'open_basedir', - ] + ], ]; /** @@ -279,12 +279,12 @@ public function &getConfig(): array return $this->config; } - $registry = new Registry(new \JConfig()); + $registry = new Registry(new \JConfig()); $this->config = $registry->toArray(); - $hidden = [ + $hidden = [ 'host', 'user', 'password', 'ftp_user', 'ftp_pass', 'smtpuser', 'smtppass', 'redis_server_auth', 'session_redis_server_auth', - 'proxy_user', 'proxy_pass', 'secret' + 'proxy_user', 'proxy_pass', 'secret', ]; foreach ($hidden as $key) { @@ -393,13 +393,13 @@ public function &getPHPInfo(): string $phpInfo = ob_get_contents(); ob_end_clean(); preg_match_all('#]*>(.*)#siU', $phpInfo, $output); - $output = preg_replace('#]*>#', '', $output[1][0]); - $output = preg_replace('#(\w),(\w)#', '\1, \2', $output); - $output = preg_replace('#
#', '', $output); - $output = str_replace('
', '', $output); - $output = preg_replace('#
(.*)#', '$1', $output); - $output = str_replace('
', '', $output); - $output = str_replace('', '', $output); + $output = preg_replace('#]*>#', '', $output[1][0]); + $output = preg_replace('#(\w),(\w)#', '\1, \2', $output); + $output = preg_replace('#
#', '', $output); + $output = str_replace('
', '', $output); + $output = preg_replace('#
(.*)#', '$1', $output); + $output = str_replace('
', '', $output); + $output = str_replace('', '', $output); $this->php_info = $output; return $this->php_info; @@ -482,7 +482,7 @@ public function getExtensions(): array 'author' => $manifest->get('author', ''), 'version' => $manifest->get('version', ''), 'creationDate' => $manifest->get('creationDate', ''), - 'authorUrl' => $manifest->get('authorUrl', '') + 'authorUrl' => $manifest->get('authorUrl', ''), ]; $installed[$extension->name] = array_merge($installed[$extension->name], $extraData); @@ -681,15 +681,15 @@ public function &getEditor(): string */ protected function parsePhpInfo(string $html): array { - $html = strip_tags($html, '

'); - $html = preg_replace('/]*>([^<]+)<\/th>/', '\1', $html); - $html = preg_replace('/]*>([^<]+)<\/td>/', '\1', $html); - $t = preg_split('/(]*>[^<]+<\/h2>)/', $html, -1, PREG_SPLIT_DELIM_CAPTURE); - $r = []; + $html = strip_tags($html, '

'); + $html = preg_replace('/]*>([^<]+)<\/th>/', '\1', $html); + $html = preg_replace('/]*>([^<]+)<\/td>/', '\1', $html); + $t = preg_split('/(]*>[^<]+<\/h2>)/', $html, -1, PREG_SPLIT_DELIM_CAPTURE); + $r = []; $count = \count($t); - $p1 = '([^<]+)<\/info>'; - $p2 = '/' . $p1 . '\s*' . $p1 . '\s*' . $p1 . '/'; - $p3 = '/' . $p1 . '\s*' . $p1 . '/'; + $p1 = '([^<]+)<\/info>'; + $p2 = '/' . $p1 . '\s*' . $p1 . '\s*' . $p1 . '/'; + $p3 = '/' . $p1 . '\s*' . $p1 . '/'; for ($i = 1; $i < $count; $i++) { if (preg_match('/]*>([^<]+)<\/h2>/', $t[$i], $matches)) { diff --git a/administrator/components/com_admin/src/View/Sysinfo/JsonView.php b/administrator/components/com_admin/src/View/Sysinfo/JsonView.php index c11a1cdf55a34..4ea9d7d79ef07 100644 --- a/administrator/components/com_admin/src/View/Sysinfo/JsonView.php +++ b/administrator/components/com_admin/src/View/Sysinfo/JsonView.php @@ -75,7 +75,7 @@ protected function getLayoutData(): array 'config' => $model->getSafeData('config'), 'directories' => $model->getSafeData('directory', true), 'phpInfo' => $model->getSafeData('phpInfoArray'), - 'extensions' => $model->getSafeData('extensions') + 'extensions' => $model->getSafeData('extensions'), ]; } } diff --git a/administrator/components/com_admin/src/View/Sysinfo/TextView.php b/administrator/components/com_admin/src/View/Sysinfo/TextView.php index 4fb1b77b60369..603c565aeaebe 100644 --- a/administrator/components/com_admin/src/View/Sysinfo/TextView.php +++ b/administrator/components/com_admin/src/View/Sysinfo/TextView.php @@ -85,28 +85,28 @@ protected function getLayoutData(): array return [ 'info' => [ 'title' => Text::_('COM_ADMIN_SYSTEM_INFORMATION', true), - 'data' => $model->getSafeData('info') + 'data' => $model->getSafeData('info'), ], 'phpSettings' => [ 'title' => Text::_('COM_ADMIN_PHP_SETTINGS', true), - 'data' => $model->getSafeData('phpSettings') + 'data' => $model->getSafeData('phpSettings'), ], 'config' => [ 'title' => Text::_('COM_ADMIN_CONFIGURATION_FILE', true), - 'data' => $model->getSafeData('config') + 'data' => $model->getSafeData('config'), ], 'directories' => [ 'title' => Text::_('COM_ADMIN_DIRECTORY_PERMISSIONS', true), - 'data' => $model->getSafeData('directory', true) + 'data' => $model->getSafeData('directory', true), ], 'phpInfo' => [ 'title' => Text::_('COM_ADMIN_PHP_INFORMATION', true), - 'data' => $model->getSafeData('phpInfoArray') + 'data' => $model->getSafeData('phpInfoArray'), ], 'extensions' => [ 'title' => Text::_('COM_ADMIN_EXTENSIONS', true), - 'data' => $model->getSafeData('extensions') - ] + 'data' => $model->getSafeData('extensions'), + ], ]; } diff --git a/administrator/components/com_associations/services/provider.php b/administrator/components/com_associations/services/provider.php index 071fec0053bf2..481a24025f6cf 100644 --- a/administrator/components/com_associations/services/provider.php +++ b/administrator/components/com_associations/services/provider.php @@ -24,8 +24,7 @@ * * @since 4.0.0 */ -return new class implements ServiceProviderInterface -{ +return new class () implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * diff --git a/administrator/components/com_associations/src/Field/ItemtypeField.php b/administrator/components/com_associations/src/Field/ItemtypeField.php index 012fe5fced9c6..509496baed437 100644 --- a/administrator/components/com_associations/src/Field/ItemtypeField.php +++ b/administrator/components/com_associations/src/Field/ItemtypeField.php @@ -51,7 +51,7 @@ protected function getGroups() foreach ($extensions as $extension) { if ($extension->get('associationssupport') === true) { foreach ($extension->get('types') as $type) { - $context = $extension->get('component') . '.' . $type->get('name'); + $context = $extension->get('component') . '.' . $type->get('name'); $options[$extension->get('title')][] = HTMLHelper::_('select.option', $context, $type->get('title')); } } diff --git a/administrator/components/com_associations/src/Field/Modal/AssociationField.php b/administrator/components/com_associations/src/Field/Modal/AssociationField.php index 3a660e91bd977..e68292c596f38 100644 --- a/administrator/components/com_associations/src/Field/Modal/AssociationField.php +++ b/administrator/components/com_associations/src/Field/Modal/AssociationField.php @@ -93,14 +93,14 @@ protected function getInput() 'bootstrap.renderModal', 'associationSelect' . $this->id . 'Modal', [ - 'title' => Text::_('COM_ASSOCIATIONS_SELECT_TARGET'), - 'backdrop' => 'static', - 'url' => $urlSelect, - 'height' => '400px', - 'width' => '800px', - 'bodyHeight' => 70, - 'modalWidth' => 80, - 'footer' => '', ] ); diff --git a/administrator/components/com_associations/src/Helper/AssociationsHelper.php b/administrator/components/com_associations/src/Helper/AssociationsHelper.php index 9e32fa6996a2f..5fd7523383e18 100644 --- a/administrator/components/com_associations/src/Helper/AssociationsHelper.php +++ b/administrator/components/com_associations/src/Helper/AssociationsHelper.php @@ -218,7 +218,7 @@ public static function getAssociationHtmlList($extensionName, $typeName, $itemId $titleFieldName = self::getTypeFieldName($extensionName, $typeName, 'title'); // Get all content languages. - $languages = LanguageHelper::getContentLanguages([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 diff --git a/administrator/components/com_associations/src/Model/AssociationsModel.php b/administrator/components/com_associations/src/Model/AssociationsModel.php index 2a60d16b6c7c7..3e3ecc3491208 100644 --- a/administrator/components/com_associations/src/Model/AssociationsModel.php +++ b/administrator/components/com_associations/src/Model/AssociationsModel.php @@ -367,7 +367,7 @@ protected function getListQuery() ->bind(':extensionname', $extensionName); } elseif ($typeNameExploded = explode('.', $typeName)) { if (\count($typeNameExploded) > 1 && array_pop($typeNameExploded) === 'category') { - $section = implode('.', $typeNameExploded); + $section = implode('.', $typeNameExploded); $extensionNameSection = $extensionName . '.' . $section; $query->where($db->quoteName('a.extension') . ' = :extensionsection') ->bind(':extensionsection', $extensionNameSection); diff --git a/administrator/components/com_associations/src/View/Associations/HtmlView.php b/administrator/components/com_associations/src/View/Associations/HtmlView.php index bd309595a0ee4..e6e8527ae033d 100644 --- a/administrator/components/com_associations/src/View/Associations/HtmlView.php +++ b/administrator/components/com_associations/src/View/Associations/HtmlView.php @@ -110,12 +110,12 @@ public function display($tpl = null) $details = $type->get('details'); if (\array_key_exists('support', $details)) { - $support = $details['support']; + $support = $details['support']; $this->typeSupports = $support; } if (\array_key_exists('fields', $details)) { - $fields = $details['fields']; + $fields = $details['fields']; $this->typeFields = $fields; } @@ -166,9 +166,9 @@ public function display($tpl = null) $this->pagination = $this->get('Pagination'); $linkParameters = [ - 'layout' => 'edit', - 'itemtype' => $extensionName . '.' . $typeName, - 'task' => 'association.edit', + '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_banners/services/provider.php b/administrator/components/com_banners/services/provider.php index 02bb499b3d240..e97106917ead5 100644 --- a/administrator/components/com_banners/services/provider.php +++ b/administrator/components/com_banners/services/provider.php @@ -29,8 +29,7 @@ * * @since 4.0.0 */ -return new class implements ServiceProviderInterface -{ +return new class () implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * diff --git a/administrator/components/com_banners/src/Controller/BannersController.php b/administrator/components/com_banners/src/Controller/BannersController.php index 8203f83a0b0f6..b5507d7a76e1e 100644 --- a/administrator/components/com_banners/src/Controller/BannersController.php +++ b/administrator/components/com_banners/src/Controller/BannersController.php @@ -133,7 +133,7 @@ public function getQuickiconContent() $result['amount'] = $amount; $result['sronly'] = Text::plural('COM_BANNERS_N_QUICKICON_SRONLY', $amount); - $result['name'] = Text::plural('COM_BANNERS_N_QUICKICON', $amount); + $result['name'] = Text::plural('COM_BANNERS_N_QUICKICON', $amount); echo new JsonResponse($result); } diff --git a/administrator/components/com_banners/src/Helper/BannersHelper.php b/administrator/components/com_banners/src/Helper/BannersHelper.php index 53dda5686a107..090d733c426a1 100644 --- a/administrator/components/com_banners/src/Helper/BannersHelper.php +++ b/administrator/components/com_banners/src/Helper/BannersHelper.php @@ -84,7 +84,7 @@ public static function updateReset() } if ($purchaseType < 0) { - $params = ComponentHelper::getParams('com_banners'); + $params = ComponentHelper::getParams('com_banners'); $purchaseType = $params->get('purchase_type'); } @@ -93,19 +93,19 @@ public static function updateReset() $reset = null; break; case 2: - $date = Factory::getDate('+1 year ' . date('Y-m-d')); + $date = Factory::getDate('+1 year ' . date('Y-m-d')); $reset = $date->toSql(); break; case 3: - $date = Factory::getDate('+1 month ' . date('Y-m-d')); + $date = Factory::getDate('+1 month ' . date('Y-m-d')); $reset = $date->toSql(); break; case 4: - $date = Factory::getDate('+7 day ' . date('Y-m-d')); + $date = Factory::getDate('+7 day ' . date('Y-m-d')); $reset = $date->toSql(); break; case 5: - $date = Factory::getDate('+1 day ' . date('Y-m-d')); + $date = Factory::getDate('+1 day ' . date('Y-m-d')); $reset = $date->toSql(); break; } @@ -147,7 +147,7 @@ public static function getClientOptions() { $options = []; - $db = Factory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true) ->select( [ diff --git a/administrator/components/com_banners/src/Model/BannerModel.php b/administrator/components/com_banners/src/Model/BannerModel.php index dfd52729f8dd0..cc244df4cc977 100644 --- a/administrator/components/com_banners/src/Model/BannerModel.php +++ b/administrator/components/com_banners/src/Model/BannerModel.php @@ -61,7 +61,7 @@ class BannerModel extends AdminModel */ protected $batch_commands = [ 'client_id' => 'batchClient', - 'language_id' => 'batchLanguage' + 'language_id' => 'batchLanguage', ]; /** @@ -143,8 +143,8 @@ protected function canDelete($record) public function generateTitle($categoryId, $table) { // Alter the title & alias - $data = $this->generateNewTitle($categoryId, $table->alias, $table->name); - $table->name = $data['0']; + $data = $this->generateNewTitle($categoryId, $table->alias, $table->name); + $table->name = $data['0']; $table->alias = $data['1']; } @@ -320,7 +320,7 @@ protected function prepareTable($table) // Set ordering to the last item if not set if (empty($table->ordering)) { - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true) ->select('MAX(' . $db->quoteName('ordering') . ')') ->from($db->quoteName('#__banners')); diff --git a/administrator/components/com_banners/src/Model/BannersModel.php b/administrator/components/com_banners/src/Model/BannersModel.php index 5f7683b26f0e3..4b8dd96ff3572 100644 --- a/administrator/components/com_banners/src/Model/BannersModel.php +++ b/administrator/components/com_banners/src/Model/BannersModel.php @@ -74,7 +74,7 @@ public function __construct($config = []) public function &getCategoryOrders() { if (!isset($this->cache['categoryorders'])) { - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true) ->select( [ @@ -100,7 +100,7 @@ public function &getCategoryOrders() */ protected function getListQuery() { - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true); // Select the required fields from the table. diff --git a/administrator/components/com_banners/src/Model/ClientsModel.php b/administrator/components/com_banners/src/Model/ClientsModel.php index 5ae41c93df78a..52c9281a180d3 100644 --- a/administrator/components/com_banners/src/Model/ClientsModel.php +++ b/administrator/components/com_banners/src/Model/ClientsModel.php @@ -42,7 +42,7 @@ public function __construct($config = []) 'state', 'a.state', 'checked_out', 'a.checked_out', 'checked_out_time', 'a.checked_out_time', - 'purchase_type', 'a.purchase_type' + 'purchase_type', 'a.purchase_type', ]; } @@ -221,7 +221,7 @@ public function getItems() // Faster to do three queries for very large banner trees. // Get the clients in the list. - $db = $this->getDatabase(); + $db = $this->getDatabase(); $clientIds = array_column($items, 'id'); $query = $db->getQuery(true) @@ -241,7 +241,7 @@ public function getItems() // Get the published banners count. try { - $state = 1; + $state = 1; $countPublished = $db->loadAssocList('cid', 'count_published'); } catch (\RuntimeException $e) { $this->setError($e->getMessage()); @@ -251,7 +251,7 @@ public function getItems() // Get the unpublished banners count. try { - $state = 0; + $state = 0; $countUnpublished = $db->loadAssocList('cid', 'count_published'); } catch (\RuntimeException $e) { $this->setError($e->getMessage()); @@ -261,7 +261,7 @@ public function getItems() // Get the trashed banners count. try { - $state = -2; + $state = -2; $countTrashed = $db->loadAssocList('cid', 'count_published'); } catch (\RuntimeException $e) { $this->setError($e->getMessage()); @@ -271,7 +271,7 @@ public function getItems() // Get the archived banners count. try { - $state = 2; + $state = 2; $countArchived = $db->loadAssocList('cid', 'count_published'); } catch (\RuntimeException $e) { $this->setError($e->getMessage()); diff --git a/administrator/components/com_banners/src/Model/TracksModel.php b/administrator/components/com_banners/src/Model/TracksModel.php index 59a3ae1a40076..7c1390b6074ec 100644 --- a/administrator/components/com_banners/src/Model/TracksModel.php +++ b/administrator/components/com_banners/src/Model/TracksModel.php @@ -94,7 +94,7 @@ protected function populateState($ordering = 'b.name', $direction = 'asc') protected function getListQuery() { // Create a new query object. - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true); // Select the required fields from the table. @@ -276,7 +276,7 @@ public function getBaseName() } $categoryName = $this->getCategoryName(); - $basename = str_replace('__CATNAME__', $categoryName, $basename); + $basename = str_replace('__CATNAME__', $categoryName, $basename); } else { $basename = str_replace(['__CATID__', '__CATNAME__'], '', $basename); } @@ -291,7 +291,7 @@ public function getBaseName() } $clientName = $this->getClientName(); - $basename = str_replace('__CLIENTNAME__', $clientName, $basename); + $basename = str_replace('__CLIENTNAME__', $clientName, $basename); } else { $basename = str_replace(['__CLIENTID__', '__CLIENTNAME__'], '', $basename); } @@ -453,8 +453,8 @@ public function getContent() 'track' => [ 'name' => $this->getBaseName() . '.csv', 'data' => $this->content, - 'time' => time() - ] + 'time' => time(), + ], ]; $ziproot = $app->get('tmp_path') . '/' . uniqid('banners_tracks_') . '.zip'; diff --git a/administrator/components/com_banners/src/Service/Html/Banner.php b/administrator/components/com_banners/src/Service/Html/Banner.php index d463d2266d460..244ed7d0b31c9 100644 --- a/administrator/components/com_banners/src/Service/Html/Banner.php +++ b/administrator/components/com_banners/src/Service/Html/Banner.php @@ -48,7 +48,7 @@ public function clients() '', '', HTMLHelper::_('select.options', static::clientlist(), 'value', 'text'), - '' + '', ] ); } @@ -108,7 +108,7 @@ public function pinned($value, $i, $enabled = true, $checkbox = 'cb') 'COM_BANNERS_BANNERS_PINNED', true, 'publish', - 'publish' + 'publish', ], 0 => [ 'sticky_publish', @@ -117,7 +117,7 @@ public function pinned($value, $i, $enabled = true, $checkbox = 'cb') 'COM_BANNERS_BANNERS_UNPINNED', true, 'unpublish', - 'unpublish' + 'unpublish', ], ]; diff --git a/administrator/components/com_banners/src/Table/BannerTable.php b/administrator/components/com_banners/src/Table/BannerTable.php index d98954985fbc2..d3cee7485bfa7 100644 --- a/administrator/components/com_banners/src/Table/BannerTable.php +++ b/administrator/components/com_banners/src/Table/BannerTable.php @@ -231,19 +231,19 @@ public function store($updateNulls = true) $this->reset = null; break; case 2: - $date = Factory::getDate('+1 year ' . date('Y-m-d')); + $date = Factory::getDate('+1 year ' . date('Y-m-d')); $this->reset = $date->toSql(); break; case 3: - $date = Factory::getDate('+1 month ' . date('Y-m-d')); + $date = Factory::getDate('+1 month ' . date('Y-m-d')); $this->reset = $date->toSql(); break; case 4: - $date = Factory::getDate('+7 day ' . date('Y-m-d')); + $date = Factory::getDate('+7 day ' . date('Y-m-d')); $this->reset = $date->toSql(); break; case 5: - $date = Factory::getDate('+1 day ' . date('Y-m-d')); + $date = Factory::getDate('+1 day ' . date('Y-m-d')); $this->reset = $date->toSql(); break; } @@ -330,8 +330,8 @@ public function stick($pks = null, $state = 1, $userId = 0) // Verify checkout if (\is_null($table->checked_out) || $table->checked_out == $userId) { // Change the state - $table->sticky = $state; - $table->checked_out = null; + $table->sticky = $state; + $table->checked_out = null; $table->checked_out_time = null; // Check the row diff --git a/administrator/components/com_banners/src/View/Tracks/HtmlView.php b/administrator/components/com_banners/src/View/Tracks/HtmlView.php index 65929ca329c85..ba79131d71007 100644 --- a/administrator/components/com_banners/src/View/Tracks/HtmlView.php +++ b/administrator/components/com_banners/src/View/Tracks/HtmlView.php @@ -125,7 +125,7 @@ public function display($tpl = null): void */ protected function addToolbar(): void { - $canDo = ContentHelper::getActions('com_banners', 'category', $this->state->get('filter.category_id')); + $canDo = ContentHelper::getActions('com_banners', 'category', $this->state->get('filter.category_id')); $toolbar = Toolbar::getInstance(); ToolbarHelper::title(Text::_('COM_BANNERS_MANAGER_TRACKS'), 'bookmark banners-tracks'); diff --git a/administrator/components/com_cache/services/provider.php b/administrator/components/com_cache/services/provider.php index 01ca10a33e748..ef0ea0ee7811c 100644 --- a/administrator/components/com_cache/services/provider.php +++ b/administrator/components/com_cache/services/provider.php @@ -24,8 +24,7 @@ * * @since 4.0.0 */ -return new class implements ServiceProviderInterface -{ +return new class () implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * diff --git a/administrator/components/com_cache/src/Model/CacheModel.php b/administrator/components/com_cache/src/Model/CacheModel.php index 08520d8ced946..63f2ad17d143d 100644 --- a/administrator/components/com_cache/src/Model/CacheModel.php +++ b/administrator/components/com_cache/src/Model/CacheModel.php @@ -178,7 +178,7 @@ public function getCache() 'defaultgroup' => '', 'storage' => $app->get('cache_handler', ''), 'caching' => true, - 'cachebase' => $app->get('cache_path', JPATH_CACHE) + 'cachebase' => $app->get('cache_path', JPATH_CACHE), ]; return Cache::getInstance('', $options); diff --git a/administrator/components/com_categories/services/provider.php b/administrator/components/com_categories/services/provider.php index 043c4850d6425..01d9a2f8d1e60 100644 --- a/administrator/components/com_categories/services/provider.php +++ b/administrator/components/com_categories/services/provider.php @@ -25,8 +25,7 @@ * * @since 4.0.0 */ -return new class implements ServiceProviderInterface -{ +return new class () implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * diff --git a/administrator/components/com_categories/src/Controller/CategoriesController.php b/administrator/components/com_categories/src/Controller/CategoriesController.php index 5c79b7d5ebb13..3039ecf0c4ec8 100644 --- a/administrator/components/com_categories/src/Controller/CategoriesController.php +++ b/administrator/components/com_categories/src/Controller/CategoriesController.php @@ -61,7 +61,7 @@ public function getQuickiconContent() $result['amount'] = $amount; $result['sronly'] = Text::plural('COM_CATEGORIES_N_QUICKICON_SRONLY', $amount); - $result['name'] = Text::plural('COM_CATEGORIES_N_QUICKICON', $amount); + $result['name'] = Text::plural('COM_CATEGORIES_N_QUICKICON', $amount); echo new JsonResponse($result); } diff --git a/administrator/components/com_categories/src/Controller/CategoryController.php b/administrator/components/com_categories/src/Controller/CategoryController.php index f190d53f8f7c4..e457e1ae9d950 100644 --- a/administrator/components/com_categories/src/Controller/CategoryController.php +++ b/administrator/components/com_categories/src/Controller/CategoryController.php @@ -88,7 +88,7 @@ protected function allowAdd($data = []) protected function allowEdit($data = [], $key = 'parent_id') { $recordId = (int) isset($data[$key]) ? $data[$key] : 0; - $user = $this->app->getIdentity(); + $user = $this->app->getIdentity(); // Check "edit" permission on record asset (explicit or inherited) if ($user->authorise('core.edit', $this->extension . '.category.' . $recordId)) { @@ -235,12 +235,12 @@ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) $item = $model->getItem(); if (isset($item->params) && \is_array($item->params)) { - $registry = new Registry($item->params); + $registry = new Registry($item->params); $item->params = (string) $registry; } if (isset($item->metadata) && \is_array($item->metadata)) { - $registry = new Registry($item->metadata); + $registry = new Registry($item->metadata); $item->metadata = (string) $registry; } } diff --git a/administrator/components/com_categories/src/Field/CategoryeditField.php b/administrator/components/com_categories/src/Field/CategoryeditField.php index 8a5b2f946b6b7..f791bcf0baf67 100644 --- a/administrator/components/com_categories/src/Field/CategoryeditField.php +++ b/administrator/components/com_categories/src/Field/CategoryeditField.php @@ -79,7 +79,7 @@ public function setup(\SimpleXMLElement $element, $value, $group = null) $return = parent::setup($element, $value, $group); if ($return) { - $this->allowAdd = isset($this->element['allowAdd']) ? (bool) $this->element['allowAdd'] : false; + $this->allowAdd = isset($this->element['allowAdd']) ? (bool) $this->element['allowAdd'] : false; $this->customPrefix = (string) $this->element['customPrefix']; } @@ -123,7 +123,7 @@ public function __set($name, $value) switch ($name) { case 'allowAdd': - $value = (string) $value; + $value = (string) $value; $this->$name = ($value === 'true' || $value === $name || $value === '1'); break; case 'customPrefix': @@ -145,9 +145,9 @@ public function __set($name, $value) */ protected function getOptions() { - $options = []; + $options = []; $published = $this->element['published'] ? explode(',', (string) $this->element['published']) : [0, 1]; - $name = (string) $this->element['name']; + $name = (string) $this->element['name']; // Let's get the id for the current item, either category or content item. $jinput = Factory::getApplication()->getInput(); @@ -156,12 +156,11 @@ protected function getOptions() // For categories the old category is the category id or 0 for new category. if ($this->element['parent'] || $jinput->get('option') == 'com_categories') { - $oldCat = $jinput->get('id', 0); + $oldCat = $jinput->get('id', 0); $oldParent = $this->form->getValue($name, 0); $extension = $this->element['extension'] ? (string) $this->element['extension'] : (string) $jinput->get('extension', 'com_content'); - } else // For items the old category is the category they are in when opened or 0 if new. - { - $oldCat = $this->form->getValue($name, 0); + } else { // For items the old category is the category they are in when opened or 0 if new. + $oldCat = $this->form->getValue($name, 0); $extension = $this->element['extension'] ? (string) $this->element['extension'] : (string) $jinput->get('option', 'com_content'); } @@ -332,7 +331,7 @@ protected function getOptions() $row = $db->loadObject(); if ($row->parent_id == '1') { - $parent = new \stdClass(); + $parent = new \stdClass(); $parent->text = Text::_('JGLOBAL_ROOT_PARENT'); array_unshift($options, $parent); } diff --git a/administrator/components/com_categories/src/Field/ComponentsCategoryField.php b/administrator/components/com_categories/src/Field/ComponentsCategoryField.php index e8f9f291c994f..c6599b83b6127 100644 --- a/administrator/components/com_categories/src/Field/ComponentsCategoryField.php +++ b/administrator/components/com_categories/src/Field/ComponentsCategoryField.php @@ -72,8 +72,7 @@ protected function getOptions() // If the component section string exists, let's use it if ($lang->hasKey($component_section_key = strtoupper($component . ($section ? "_$section" : '')))) { $option->text = Text::_($component_section_key); - } else // Else use the component title - { + } else { // Else use the component title $option->text = Text::_(strtoupper($component)); } diff --git a/administrator/components/com_categories/src/Field/Modal/CategoryField.php b/administrator/components/com_categories/src/Field/Modal/CategoryField.php index 71f4ef77e7b4c..b048120f737d1 100644 --- a/administrator/components/com_categories/src/Field/Modal/CategoryField.php +++ b/administrator/components/com_categories/src/Field/Modal/CategoryField.php @@ -108,8 +108,8 @@ protected function getInput() if (isset($this->element['language'])) { $linkCategories .= '&forcedLanguage=' . $this->element['language']; - $linkCategory .= '&forcedLanguage=' . $this->element['language']; - $modalTitle .= ' — ' . $this->element['label']; + $linkCategory .= '&forcedLanguage=' . $this->element['language']; + $modalTitle .= ' — ' . $this->element['label']; } $urlSelect = $linkCategories . '&function=jSelectCategory_' . $this->id; @@ -193,7 +193,7 @@ protected function getInput() // Propagate category button if ($allowPropagate && \count($languages) > 2) { // Strip off language tag at the end - $tagLength = (int) \strlen($this->element['language']); + $tagLength = (int) \strlen($this->element['language']); $callbackFunctionStem = substr("jSelectCategory_" . $this->id, 0, -$tagLength); $html .= ' $modalTitle, - 'url' => $urlSelect, - 'height' => '400px', - 'width' => '800px', - 'bodyHeight' => 70, - 'modalWidth' => 80, - 'footer' => '', ] ); diff --git a/administrator/components/com_categories/src/Helper/CategoriesHelper.php b/administrator/components/com_categories/src/Helper/CategoriesHelper.php index c98e6f83ac837..36d247022ff4a 100644 --- a/administrator/components/com_categories/src/Helper/CategoriesHelper.php +++ b/administrator/components/com_categories/src/Helper/CategoriesHelper.php @@ -76,8 +76,8 @@ public static function validateCategoryId($catid, $extension) { $categoryTable = Table::getInstance('CategoryTable', '\\Joomla\\Component\\Categories\\Administrator\\Table\\'); - $data = []; - $data['id'] = $catid; + $data = []; + $data['id'] = $catid; $data['extension'] = $extension; if (!$categoryTable->load($data)) { diff --git a/administrator/components/com_categories/src/Model/CategoriesModel.php b/administrator/components/com_categories/src/Model/CategoriesModel.php index 2e77e02e8c4e2..dffd9bd7711c1 100644 --- a/administrator/components/com_categories/src/Model/CategoriesModel.php +++ b/administrator/components/com_categories/src/Model/CategoriesModel.php @@ -161,9 +161,9 @@ protected function getStoreId($id = '') protected function getListQuery() { // Create a new query object. - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true); - $user = $this->getCurrentUser(); + $user = $this->getCurrentUser(); // Select the required fields from the table. $query->select( @@ -345,7 +345,7 @@ protected function getListQuery() // Add the list ordering clause $listOrdering = $this->getState('list.ordering', 'a.lft'); - $listDirn = $db->escape($this->getState('list.direction', 'ASC')); + $listDirn = $db->escape($this->getState('list.direction', 'ASC')); if ($listOrdering == 'a.access') { $query->order('a.access ' . $listDirn . ', a.lft ' . $listDirn); @@ -394,9 +394,9 @@ public function getAssoc() $extension = $this->getState('filter.extension'); $this->hasAssociation = Associations::isEnabled(); - $extension = explode('.', $extension); - $component = array_shift($extension); - $cname = str_replace('com_', '', $component); + $extension = explode('.', $extension); + $component = array_shift($extension); + $cname = str_replace('com_', '', $component); if (!$this->hasAssociation || !$component || !$cname) { $this->hasAssociation = false; diff --git a/administrator/components/com_categories/src/Model/CategoryModel.php b/administrator/components/com_categories/src/Model/CategoryModel.php index 25a124b85f658..f93a7280e15ab 100644 --- a/administrator/components/com_categories/src/Model/CategoryModel.php +++ b/administrator/components/com_categories/src/Model/CategoryModel.php @@ -89,7 +89,7 @@ class CategoryModel extends AdminModel */ public function __construct($config = [], MVCFactoryInterface $factory = null) { - $extension = Factory::getApplication()->getInput()->get('extension', 'com_content'); + $extension = Factory::getApplication()->getInput()->get('extension', 'com_content'); $this->typeAlias = $extension . '.category'; // Add a new batch command @@ -213,7 +213,7 @@ public function getItem($pk = null) } // Convert the metadata field to an array. - $registry = new Registry($result->metadata); + $registry = new Registry($result->metadata); $result->metadata = $registry->toArray(); if (!empty($result->id)) { @@ -248,12 +248,12 @@ public function getItem($pk = null) public function getForm($data = [], $loadData = true) { $extension = $this->getState('category.extension'); - $jinput = Factory::getApplication()->getInput(); + $jinput = Factory::getApplication()->getInput(); // A workaround to get the extension into the model for save requests. if (empty($extension) && isset($data['extension'])) { $extension = $data['extension']; - $parts = explode('.', $extension); + $parts = explode('.', $extension); $this->setState('category.extension', $extension); $this->setState('category.component', $parts[0]); @@ -324,7 +324,7 @@ protected function getReorderConditions($table) protected function loadFormData() { // Check the session for previously entered form data. - $app = Factory::getApplication(); + $app = Factory::getApplication(); $data = $app->getUserState('com_categories.edit.' . $this->getName() . '.data', []); if (empty($data)) { @@ -334,7 +334,7 @@ protected function loadFormData() if (!$data->id) { // Check for which extension the Category Manager is used and get selected fields $extension = substr($app->getUserState('com_categories.categories.filter.extension', ''), 4); - $filters = (array) $app->getUserState('com_categories.categories.' . $extension . '.filter'); + $filters = (array) $app->getUserState('com_categories.categories.' . $extension . '.filter'); $data->set( 'published', @@ -397,9 +397,9 @@ public function validate($form, $data, $group = null) */ protected function preprocessForm(Form $form, $data, $group = 'content') { - $lang = Factory::getLanguage(); + $lang = Factory::getLanguage(); $component = $this->getState('category.component'); - $section = $this->getState('category.section'); + $section = $this->getState('category.section'); $extension = Factory::getApplication()->getInput()->get('extension', null); // Get the component form if it exists @@ -434,7 +434,7 @@ protected function preprocessForm(Form $form, $data, $group = 'content') } else { // Try to find the component helper. $eName = str_replace('com_', '', $component); - $path = Path::clean(JPATH_ADMINISTRATOR . "/components/$component/helpers/category.php"); + $path = Path::clean(JPATH_ADMINISTRATOR . "/components/$component/helpers/category.php"); if (file_exists($path)) { $cName = ucfirst($eName) . ucfirst($section) . 'HelperCategory'; @@ -468,7 +468,7 @@ protected function preprocessForm(Form $form, $data, $group = 'content') if (\count($languages) > 1) { $addform = new \SimpleXMLElement('
'); - $fields = $addform->addChild('fields'); + $fields = $addform->addChild('fields'); $fields->addAttribute('name', 'associations'); $fieldset = $fields->addChild('fieldset'); $fieldset->addAttribute('name', 'item_associations'); @@ -538,8 +538,8 @@ public function save($data) if ($data['title'] == $origTable->title) { [$title, $alias] = $this->generateNewTitle($data['parent_id'], $data['alias'], $data['title']); - $data['title'] = $title; - $data['alias'] = $alias; + $data['title'] = $title; + $data['alias'] = $alias; } else { if ($data['alias'] == $origTable->alias) { $data['alias'] = ''; @@ -817,7 +817,7 @@ protected function batchFlipordering($value, $pks, $contexts) { $successful = []; - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true); /** @@ -866,16 +866,16 @@ protected function batchFlipordering($value, $pks, $contexts) */ protected function batchCopy($value, $pks, $contexts) { - $type = new UCMType(); + $type = new UCMType(); $this->type = $type->getTypeByAlias($this->typeAlias); // $value comes as {parent_id}.{extension} - $parts = explode('.', $value); + $parts = explode('.', $value); $parentId = (int) ArrayHelper::getValue($parts, 0, 1); - $db = $this->getDatabase(); + $db = $this->getDatabase(); $extension = Factory::getApplication()->input->get('extension', '', 'word'); - $newIds = []; + $newIds = []; // Check that the parent exists if ($parentId) { @@ -996,13 +996,13 @@ protected function batchCopy($value, $pks, $contexts) // @TODO: Deal with ordering? // $this->table->ordering = 1; - $this->table->level = null; + $this->table->level = null; $this->table->asset_id = null; - $this->table->lft = null; - $this->table->rgt = null; + $this->table->lft = null; + $this->table->rgt = null; // Alter the title & alias - [$title, $alias] = $this->generateNewTitle($this->table->parent_id, $this->table->alias, $this->table->title); + [$title, $alias] = $this->generateNewTitle($this->table->parent_id, $this->table->alias, $this->table->title); $this->table->title = $title; $this->table->alias = $alias; @@ -1071,12 +1071,12 @@ protected function batchCopy($value, $pks, $contexts) */ protected function batchMove($value, $pks, $contexts) { - $parentId = (int) $value; - $type = new UCMType(); + $parentId = (int) $value; + $type = new UCMType(); $this->type = $type->getTypeByAlias($this->typeAlias); - $db = $this->getDatabase(); - $query = $db->getQuery(true); + $db = $this->getDatabase(); + $query = $db->getQuery(true); $extension = Factory::getApplication()->getInput()->get('extension', '', 'word'); // Check that the parent exists. @@ -1271,9 +1271,9 @@ public function getAssoc() $extension = $this->getState('category.extension', ''); $this->hasAssociation = Associations::isEnabled(); - $extension = explode('.', $extension); - $component = array_shift($extension); - $cname = str_replace('com_', '', $component); + $extension = explode('.', $extension); + $component = array_shift($extension); + $cname = str_replace('com_', '', $component); if (!$this->hasAssociation || !$component || !$cname) { $this->hasAssociation = false; diff --git a/administrator/components/com_categories/src/Service/HTML/AdministratorService.php b/administrator/components/com_categories/src/Service/HTML/AdministratorService.php index 09fef6349644e..0267b1e81b62c 100644 --- a/administrator/components/com_categories/src/Service/HTML/AdministratorService.php +++ b/administrator/components/com_categories/src/Service/HTML/AdministratorService.php @@ -51,7 +51,7 @@ public function association($catid, $extension = 'com_content') $associations = ArrayHelper::toInteger($associations); // Get the associated categories - $db = Factory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true) ->select( [ @@ -81,7 +81,7 @@ public function association($catid, $extension = 'com_content') } if ($items) { - $languages = LanguageHelper::getContentLanguages([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/Categories/HtmlView.php b/administrator/components/com_categories/src/View/Categories/HtmlView.php index 74a52a018f73c..696b3ec6c5d52 100644 --- a/administrator/components/com_categories/src/View/Categories/HtmlView.php +++ b/administrator/components/com_categories/src/View/Categories/HtmlView.php @@ -172,10 +172,9 @@ protected function addToolbar() if ($lang->hasKey($component_title_key = strtoupper($component . ($section ? "_$section" : '')) . '_CATEGORIES_TITLE')) { $title = Text::_($component_title_key); } elseif ($lang->hasKey($component_section_key = strtoupper($component . ($section ? "_$section" : '')))) { - // Else if the component section string exists, let's use it. + // Else if the component section string exists, let's use it. $title = Text::sprintf('COM_CATEGORIES_CATEGORIES_TITLE', $this->escape(Text::_($component_section_key))); - } else // Else use the base title - { + } else { // Else use the base title $title = Text::_('COM_CATEGORIES_CATEGORIES_BASE_TITLE'); } diff --git a/administrator/components/com_categories/src/View/Category/HtmlView.php b/administrator/components/com_categories/src/View/Category/HtmlView.php index ffe203257bcfe..5d78dbad758ed 100644 --- a/administrator/components/com_categories/src/View/Category/HtmlView.php +++ b/administrator/components/com_categories/src/View/Category/HtmlView.php @@ -86,10 +86,10 @@ class HtmlView extends BaseHtmlView */ public function display($tpl = null) { - $this->form = $this->get('Form'); - $this->item = $this->get('Item'); + $this->form = $this->get('Form'); + $this->item = $this->get('Item'); $this->state = $this->get('State'); - $section = $this->state->get('category.section') ? $this->state->get('category.section') . '.' : ''; + $section = $this->state->get('category.section') ? $this->state->get('category.section') . '.' : ''; $this->canDo = ContentHelper::getActions($this->state->get('category.component'), $section . 'category', $this->item->id); $this->assoc = $this->get('Assoc'); @@ -137,7 +137,7 @@ protected function addToolbar() $userId = $user->id; $toolbar = Toolbar::getInstance(); - $isNew = ($this->item->id == 0); + $isNew = ($this->item->id == 0); $checkedOut = !(is_null($this->item->checked_out) || $this->item->checked_out == $userId); // Avoid nonsense situation. @@ -146,9 +146,9 @@ protected function addToolbar() } // The extension can be in the form com_foo.section - $parts = explode('.', $extension); - $component = $parts[0]; - $section = (count($parts) > 1) ? $parts[1] : null; + $parts = explode('.', $extension); + $component = $parts[0]; + $section = (count($parts) > 1) ? $parts[1] : null; $componentParams = ComponentHelper::getParams($component); // Need to load the menu language file as mod_menu hasn't been loaded yet. @@ -285,7 +285,7 @@ function (Toolbar $childBar) use ($checkedOut, $canDo, $itemEditable) { if (!$url) { if ($lang->hasKey($lang_help_url = strtoupper($component) . '_HELP_URL')) { $debug = $lang->setDebug(false); - $url = Text::_($lang_help_url); + $url = Text::_($lang_help_url); $lang->setDebug($debug); } } diff --git a/administrator/components/com_checkin/services/provider.php b/administrator/components/com_checkin/services/provider.php index 66b8f0fec1811..a01731c926669 100644 --- a/administrator/components/com_checkin/services/provider.php +++ b/administrator/components/com_checkin/services/provider.php @@ -24,8 +24,7 @@ * * @since 4.0.0 */ -return new class implements ServiceProviderInterface -{ +return new class () implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * diff --git a/administrator/components/com_config/services/provider.php b/administrator/components/com_config/services/provider.php index f0b39f879ae5f..e31daa67570e1 100644 --- a/administrator/components/com_config/services/provider.php +++ b/administrator/components/com_config/services/provider.php @@ -26,8 +26,7 @@ * * @since 4.0.0 */ -return new class implements ServiceProviderInterface -{ +return new class () implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * diff --git a/administrator/components/com_config/src/Controller/ApplicationController.php b/administrator/components/com_config/src/Controller/ApplicationController.php index 3c6cad9aa1c81..218f71620b2d1 100644 --- a/administrator/components/com_config/src/Controller/ApplicationController.php +++ b/administrator/components/com_config/src/Controller/ApplicationController.php @@ -90,14 +90,14 @@ public function save() // Complete data array if needed $oldData = $model->getData(); - $data = array_replace($oldData, $data); + $data = array_replace($oldData, $data); // Get request type $saveFormat = $this->app->getDocument()->getType(); // Handle service requests if ($saveFormat == 'json') { - $form = $model->getForm(); + $form = $model->getForm(); $return = $model->validate($form, $data); if ($return === false) { diff --git a/administrator/components/com_config/src/Controller/RequestController.php b/administrator/components/com_config/src/Controller/RequestController.php index 99a65d3a8410c..4ecd25cdeb5ef 100644 --- a/administrator/components/com_config/src/Controller/RequestController.php +++ b/administrator/components/com_config/src/Controller/RequestController.php @@ -88,7 +88,7 @@ public function getJson() 'debug_lang' => null, 'error_reporting' => null, 'mailfrom' => null, - 'fromname' => null + 'fromname' => null, ]; $data = array_intersect_key($data, $requiredData); diff --git a/administrator/components/com_config/src/Helper/ConfigHelper.php b/administrator/components/com_config/src/Helper/ConfigHelper.php index 59d2bde05bfad..abfbaf9e43e09 100644 --- a/administrator/components/com_config/src/Helper/ConfigHelper.php +++ b/administrator/components/com_config/src/Helper/ConfigHelper.php @@ -35,7 +35,7 @@ class ConfigHelper extends ContentHelper */ public static function getAllComponents() { - $db = Factory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true) ->select('element') ->from('#__extensions') @@ -73,9 +73,9 @@ public static function hasComponentConfig($component) */ public static function getComponentsWithConfig($authCheck = true) { - $result = []; + $result = []; $components = self::getAllComponents(); - $user = Factory::getUser(); + $user = Factory::getUser(); // Remove com_config from the array as that may have weird side effects $components = array_diff($components, ['com_config']); diff --git a/administrator/components/com_config/src/Model/ApplicationModel.php b/administrator/components/com_config/src/Model/ApplicationModel.php index 4a0bb4379a1c2..ae8704d7e7d94 100644 --- a/administrator/components/com_config/src/Model/ApplicationModel.php +++ b/administrator/components/com_config/src/Model/ApplicationModel.php @@ -106,7 +106,7 @@ public function getData() // If no filter data found, get from com_content (update of 1.6/1.7 site) if (empty($data['filters'])) { - $contentParams = ComponentHelper::getParams('com_content'); + $contentParams = ComponentHelper::getParams('com_content'); $data['filters'] = ArrayHelper::fromObject($contentParams->get('filters')); } @@ -347,8 +347,8 @@ public function save($data) [ CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false, - CURLOPT_PROXY => null, - CURLOPT_PROXYUSERPWD => null, + CURLOPT_PROXY => null, + CURLOPT_PROXYUSERPWD => null, ] ); $response = HttpFactory::getHttp($options)->get('https://' . $host . Uri::root(true) . '/', ['Host' => $host], 10); @@ -715,7 +715,7 @@ public function save($data) ); } - $error = false; + $error = false; $data['log_path'] = $defaultLogPath; } @@ -845,9 +845,9 @@ private function writeConfigFile(Registry $config) */ public function storePermissions($permission = null) { - $app = Factory::getApplication(); + $app = Factory::getApplication(); $input = $app->getInput(); - $user = $this->getCurrentUser(); + $user = $this->getCurrentUser(); if (is_null($permission)) { // Get data from input. @@ -856,7 +856,7 @@ public function storePermissions($permission = null) 'action' => $input->json->get('action'), 'rule' => $input->json->get('rule'), 'value' => $input->json->get('value'), - 'title' => $input->json->get('title', '', 'RAW') + 'title' => $input->json->get('title', '', 'RAW'), ]; } @@ -1003,9 +1003,9 @@ public function storePermissions($permission = null) // All checks done. $result = [ - 'text' => '', - 'class' => '', - 'result' => true, + 'text' => '', + 'class' => '', + 'result' => true, ]; // Show the current effective calculated permission considering current group, path and cascade. @@ -1100,7 +1100,7 @@ public function storePermissions($permission = null) // Current group is a Super User group, so calculated setting is "Allowed (Super User)". if ($isSuperUserGroupAfter) { $result['class'] = 'badge bg-success'; - $result['text'] = '' . Text::_('JLIB_RULES_ALLOWED_ADMIN'); + $result['text'] = '' . Text::_('JLIB_RULES_ALLOWED_ADMIN'); } else { // Not super user. // First get the real recursive calculated setting and add (Inherited) to it. @@ -1173,9 +1173,9 @@ public function storePermissions($permission = null) public function sendTestMail() { // Set the new values to test with the current settings - $app = Factory::getApplication(); - $user = $this->getCurrentUser(); - $input = $app->getInput()->json; + $app = Factory::getApplication(); + $user = $this->getCurrentUser(); + $input = $app->getInput()->json; $smtppass = $input->get('smtppass', null, 'RAW'); $app->set('smtpauth', $input->get('smtpauth')); @@ -1200,7 +1200,7 @@ public function sendTestMail() $mailer->addTemplateData( [ 'sitename' => $app->get('sitename'), - 'method' => Text::_('COM_CONFIG_SENDMAIL_METHOD_' . strtoupper($mail->Mailer)) + 'method' => Text::_('COM_CONFIG_SENDMAIL_METHOD_' . strtoupper($mail->Mailer)), ] ); $mailer->addRecipient($app->get('mailfrom'), $app->get('fromname')); diff --git a/administrator/components/com_config/src/Model/ComponentModel.php b/administrator/components/com_config/src/Model/ComponentModel.php index 0ac32d7cea58e..372c6e9f03b73 100644 --- a/administrator/components/com_config/src/Model/ComponentModel.php +++ b/administrator/components/com_config/src/Model/ComponentModel.php @@ -70,7 +70,7 @@ protected function populateState() */ public function getForm($data = [], $loadData = true) { - $state = $this->getState(); + $state = $this->getState(); $option = $state->get('component.option'); if ($path = $state->get('component.path')) { @@ -131,7 +131,7 @@ protected function loadFormData() */ public function getComponent() { - $state = $this->getState(); + $state = $this->getState(); $option = $state->get('component.option'); // Load common and local language files. @@ -189,7 +189,7 @@ public function save($data) if (!$asset->loadByName($data['option'])) { $root = Table::getInstance('asset'); $root->loadByName('root.1'); - $asset->name = $data['option']; + $asset->name = $data['option']; $asset->title = $data['option']; $asset->setLocation($root->id, 'last-child'); } diff --git a/administrator/components/com_config/src/View/Component/HtmlView.php b/administrator/components/com_config/src/View/Component/HtmlView.php index d2a52e50c8276..34f8273bc457a 100644 --- a/administrator/components/com_config/src/View/Component/HtmlView.php +++ b/administrator/components/com_config/src/View/Component/HtmlView.php @@ -87,14 +87,14 @@ public function display($tpl = null) unset($this->fieldsets['permissions']); } - $this->form = &$form; + $this->form = &$form; $this->component = &$component; $this->components = ConfigHelper::getComponentsWithConfig(); $this->userIsSuperAdmin = $user->authorise('core.admin'); $this->currentComponent = Factory::getApplication()->getInput()->get('component'); - $this->return = Factory::getApplication()->getInput()->get('return', '', 'base64'); + $this->return = Factory::getApplication()->getInput()->get('return', '', 'base64'); $this->addToolbar(); diff --git a/administrator/components/com_contact/services/provider.php b/administrator/components/com_contact/services/provider.php index 21f9104d289ff..7de93d94e3b5e 100644 --- a/administrator/components/com_contact/services/provider.php +++ b/administrator/components/com_contact/services/provider.php @@ -31,8 +31,7 @@ * * @since 4.0.0 */ -return new class implements ServiceProviderInterface -{ +return new class () implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * diff --git a/administrator/components/com_contact/src/Controller/ContactController.php b/administrator/components/com_contact/src/Controller/ContactController.php index 3fcef7bafa1e9..dd4916f68a1b6 100644 --- a/administrator/components/com_contact/src/Controller/ContactController.php +++ b/administrator/components/com_contact/src/Controller/ContactController.php @@ -131,10 +131,10 @@ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) $link = 'index.php?option=com_contact&view=contact'; $type = 'component'; - $editState['id'] = $id; - $editState['link'] = $link; - $editState['title'] = $model->getItem($id)->name; - $editState['type'] = $type; + $editState['id'] = $id; + $editState['link'] = $link; + $editState['title'] = $model->getItem($id)->name; + $editState['type'] = $type; $editState['request']['id'] = $id; $this->app->setUserState( diff --git a/administrator/components/com_contact/src/Controller/ContactsController.php b/administrator/components/com_contact/src/Controller/ContactsController.php index 4a576dc6770f8..003c136195b78 100644 --- a/administrator/components/com_contact/src/Controller/ContactsController.php +++ b/administrator/components/com_contact/src/Controller/ContactsController.php @@ -142,7 +142,7 @@ public function getQuickiconContent() $result['amount'] = $amount; $result['sronly'] = Text::plural('COM_CONTACT_N_QUICKICON_SRONLY', $amount); - $result['name'] = Text::plural('COM_CONTACT_N_QUICKICON', $amount); + $result['name'] = Text::plural('COM_CONTACT_N_QUICKICON', $amount); echo new JsonResponse($result); } diff --git a/administrator/components/com_contact/src/Extension/ContactComponent.php b/administrator/components/com_contact/src/Extension/ContactComponent.php index 1deb2f662bb72..303ad03e9e254 100644 --- a/administrator/components/com_contact/src/Extension/ContactComponent.php +++ b/administrator/components/com_contact/src/Extension/ContactComponent.php @@ -119,7 +119,7 @@ public function getContexts(): array $contexts = [ 'com_contact.contact' => Text::_('COM_CONTACT_FIELDS_CONTEXT_CONTACT'), 'com_contact.mail' => Text::_('COM_CONTACT_FIELDS_CONTEXT_MAIL'), - 'com_contact.categories' => Text::_('JCATEGORY') + 'com_contact.categories' => Text::_('JCATEGORY'), ]; return $contexts; diff --git a/administrator/components/com_contact/src/Field/Modal/ContactField.php b/administrator/components/com_contact/src/Field/Modal/ContactField.php index 67d386ce28c67..2f8ddc3180562 100644 --- a/administrator/components/com_contact/src/Field/Modal/ContactField.php +++ b/administrator/components/com_contact/src/Field/Modal/ContactField.php @@ -100,8 +100,8 @@ protected function getInput() if (isset($this->element['language'])) { $linkContacts .= '&forcedLanguage=' . $this->element['language']; - $linkContact .= '&forcedLanguage=' . $this->element['language']; - $modalTitle .= ' — ' . $this->element['label']; + $linkContact .= '&forcedLanguage=' . $this->element['language']; + $modalTitle .= ' — ' . $this->element['label']; } $urlSelect = $linkContacts . '&function=jSelectContact_' . $this->id; @@ -185,7 +185,7 @@ protected function getInput() // Propagate contact button if ($allowPropagate && count($languages) > 2) { // Strip off language tag at the end - $tagLength = (int) strlen($this->element['language']); + $tagLength = (int) strlen($this->element['language']); $callbackFunctionStem = substr("jSelectContact_" . $this->id, 0, -$tagLength); $html .= ' $modalTitle, - 'url' => $urlSelect, - 'height' => '400px', - 'width' => '800px', - 'bodyHeight' => 70, - 'modalWidth' => 80, - 'footer' => '', ] ); diff --git a/administrator/components/com_contact/src/Helper/AssociationsHelper.php b/administrator/components/com_contact/src/Helper/AssociationsHelper.php index 6e6f7fe5d7144..56a4951ea5f06 100644 --- a/administrator/components/com_contact/src/Helper/AssociationsHelper.php +++ b/administrator/components/com_contact/src/Helper/AssociationsHelper.php @@ -164,14 +164,14 @@ public function getType($typeName = '') $fields['title'] = 'a.name'; $fields['state'] = 'a.published'; - $support['state'] = true; - $support['acl'] = true; - $support['checkout'] = true; - $support['category'] = true; + $support['state'] = true; + $support['acl'] = true; + $support['checkout'] = true; + $support['category'] = true; $support['save2copy'] = true; $tables = [ - 'a' => '#__contact_details' + 'a' => '#__contact_details', ]; $title = 'contact'; @@ -179,18 +179,18 @@ public function getType($typeName = '') case 'category': $fields['created_user_id'] = 'a.created_user_id'; - $fields['ordering'] = 'a.lft'; - $fields['level'] = 'a.level'; - $fields['catid'] = ''; - $fields['state'] = 'a.published'; + $fields['ordering'] = 'a.lft'; + $fields['level'] = 'a.level'; + $fields['catid'] = ''; + $fields['state'] = 'a.published'; - $support['state'] = true; - $support['acl'] = true; + $support['state'] = true; + $support['acl'] = true; $support['checkout'] = true; - $support['level'] = true; + $support['level'] = true; $tables = [ - 'a' => '#__categories' + 'a' => '#__categories', ]; $title = 'category'; @@ -203,7 +203,7 @@ public function getType($typeName = '') 'support' => $support, 'tables' => $tables, 'joins' => $joins, - 'title' => $title + 'title' => $title, ]; } } diff --git a/administrator/components/com_contact/src/Model/ContactModel.php b/administrator/components/com_contact/src/Model/ContactModel.php index 8788027c656b7..bab7f3f00e18c 100644 --- a/administrator/components/com_contact/src/Model/ContactModel.php +++ b/administrator/components/com_contact/src/Model/ContactModel.php @@ -211,7 +211,7 @@ public function getItem($pk = null) { if ($item = parent::getItem($pk)) { // Convert the metadata field to an array. - $registry = new Registry($item->metadata); + $registry = new Registry($item->metadata); $item->metadata = $registry->toArray(); } @@ -321,8 +321,8 @@ public function save($data) if ($data['name'] == $origTable->name) { list($name, $alias) = $this->generateNewTitle($data['catid'], $data['alias'], $data['name']); - $data['name'] = $name; - $data['alias'] = $alias; + $data['name'] = $name; + $data['alias'] = $alias; } else { if ($data['alias'] == $origTable->alias) { $data['alias'] = ''; @@ -366,7 +366,7 @@ protected function prepareTable($table) // Set ordering to the last item if not set if (empty($table->ordering)) { - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true) ->select('MAX(ordering)') ->from($db->quoteName('#__contact_details')); @@ -377,7 +377,7 @@ protected function prepareTable($table) } } else { // Set the values - $table->modified = $date; + $table->modified = $date; $table->modified_by = $this->getCurrentUser()->id; } @@ -427,7 +427,7 @@ protected function preprocessForm(Form $form, $data, $group = 'content') if (count($languages) > 1) { $addform = new \SimpleXMLElement(''); - $fields = $addform->addChild('fields'); + $fields = $addform->addChild('fields'); $fields->addAttribute('name', 'associations'); $fieldset = $fields->addChild('fieldset'); $fieldset->addAttribute('name', 'item_associations'); diff --git a/administrator/components/com_contact/src/Model/ContactsModel.php b/administrator/components/com_contact/src/Model/ContactsModel.php index 195e58f96bf58..090a9d19ade07 100644 --- a/administrator/components/com_contact/src/Model/ContactsModel.php +++ b/administrator/components/com_contact/src/Model/ContactsModel.php @@ -142,9 +142,9 @@ protected function getStoreId($id = '') protected function getListQuery() { // Create a new query object. - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true); - $user = $this->getCurrentUser(); + $user = $this->getCurrentUser(); // Select the required fields from the table. $query->select( @@ -166,7 +166,7 @@ protected function getListQuery() $query->select( [ $db->quoteName('ul.name', 'linked_user'), - $db->quoteName('ul.email') + $db->quoteName('ul.email'), ] ) ->join( @@ -314,7 +314,7 @@ protected function getListQuery() // Filter by categories and by level $categoryId = $this->getState('filter.category_id', []); - $level = $this->getState('filter.level'); + $level = $this->getState('filter.level'); if (!is_array($categoryId)) { $categoryId = $categoryId ? [$categoryId] : []; @@ -322,8 +322,8 @@ protected function getListQuery() // Case: Using both categories filter and by level filter if (count($categoryId)) { - $categoryId = ArrayHelper::toInteger($categoryId); - $categoryTable = Table::getInstance('Category', 'JTable'); + $categoryId = ArrayHelper::toInteger($categoryId); + $categoryTable = Table::getInstance('Category', 'JTable'); $subCatItemsWhere = []; // @todo: Convert to prepared statement @@ -343,7 +343,7 @@ protected function getListQuery() } // Add the list ordering clause. - $orderCol = $this->state->get('list.ordering', 'a.name'); + $orderCol = $this->state->get('list.ordering', 'a.name'); $orderDirn = $this->state->get('list.direction', 'asc'); if ($orderCol == 'a.ordering' || $orderCol == 'category_title') { diff --git a/administrator/components/com_contact/src/Service/HTML/AdministratorService.php b/administrator/components/com_contact/src/Service/HTML/AdministratorService.php index ed6dea9ac0134..6c5c2e14a8d86 100644 --- a/administrator/components/com_contact/src/Service/HTML/AdministratorService.php +++ b/administrator/components/com_contact/src/Service/HTML/AdministratorService.php @@ -51,7 +51,7 @@ public function association($contactid) } // Get the associated contact items - $db = Factory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true) ->select( [ @@ -79,13 +79,13 @@ public function association($contactid) } if ($items) { - $languages = LanguageHelper::getContentLanguages([0, 1]); + $languages = LanguageHelper::getContentLanguages([0, 1]); $content_languages = array_column($languages, 'lang_code'); foreach ($items as &$item) { if (in_array($item->lang_code, $content_languages)) { - $text = $item->lang_code; - $url = Route::_('index.php?option=com_contact&task=contact.edit&id=' . (int) $item->id); + $text = $item->lang_code; + $url = Route::_('index.php?option=com_contact&task=contact.edit&id=' . (int) $item->id); $tooltip = '' . htmlspecialchars($item->language_title, ENT_QUOTES, 'UTF-8') . '
' . htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8') . '
' . Text::sprintf('JCATEGORY_SPRINTF', $item->category_title); $classes = 'badge bg-secondary'; @@ -123,9 +123,9 @@ public function featured($value, $i, $canChange = true) 0 => ['unfeatured', 'contacts.featured', 'COM_CONTACT_UNFEATURED', 'JGLOBAL_ITEM_FEATURE'], 1 => ['featured', 'contacts.unfeatured', 'JFEATURED', 'JGLOBAL_ITEM_UNFEATURE'], ]; - $state = ArrayHelper::getValue($states, (int) $value, $states[1]); - $icon = $state[0] === 'featured' ? 'star featured' : 'circle'; - $onclick = 'onclick="return Joomla.listItemTask(\'cb' . $i . '\',\'' . $state[1] . '\')"'; + $state = ArrayHelper::getValue($states, (int) $value, $states[1]); + $icon = $state[0] === 'featured' ? 'star featured' : 'circle'; + $onclick = 'onclick="return Joomla.listItemTask(\'cb' . $i . '\',\'' . $state[1] . '\')"'; $tooltipText = Text::_($state[3]); if (!$canChange) { diff --git a/administrator/components/com_contact/src/Service/HTML/Icon.php b/administrator/components/com_contact/src/Service/HTML/Icon.php index 7ac7297b7b784..c5f2c7a290abd 100644 --- a/administrator/components/com_contact/src/Service/HTML/Icon.php +++ b/administrator/components/com_contact/src/Service/HTML/Icon.php @@ -135,7 +135,7 @@ public function edit($contact, $params, $attribs = [], $legacy = false) $text = LayoutHelper::render('joomla.content.icons.edit_lock', ['contact' => $contact, 'tooltip' => $tooltip, 'legacy' => $legacy]); $attribs['aria-describedby'] = 'editcontact-' . (int) $contact->id; - $output = HTMLHelper::_('link', '#', $text, $attribs); + $output = HTMLHelper::_('link', '#', $text, $attribs); return $output; } @@ -166,7 +166,7 @@ public function edit($contact, $params, $attribs = [], $legacy = false) $text .= ''; $attribs['aria-describedby'] = $aria_described; - $output = HTMLHelper::_('link', Route::_($url), $text, $attribs); + $output = HTMLHelper::_('link', Route::_($url), $text, $attribs); return $output; } diff --git a/administrator/components/com_contact/src/Table/ContactTable.php b/administrator/components/com_contact/src/Table/ContactTable.php index 664cbb2267536..78bb773421246 100644 --- a/administrator/components/com_contact/src/Table/ContactTable.php +++ b/administrator/components/com_contact/src/Table/ContactTable.php @@ -195,7 +195,7 @@ public function check() // Clean up description -- eliminate quotes and <> brackets if (!empty($this->metadesc)) { // Only process if not empty - $badCharacters = ["\"", '<', '>']; + $badCharacters = ["\"", '<', '>']; $this->metadesc = StringHelper::str_ireplace($badCharacters, '', $this->metadesc); } else { $this->metadesc = ''; diff --git a/administrator/components/com_content/services/provider.php b/administrator/components/com_content/services/provider.php index 72b91c17f3e80..3220e06f7440c 100644 --- a/administrator/components/com_content/services/provider.php +++ b/administrator/components/com_content/services/provider.php @@ -31,8 +31,7 @@ * * @since 4.0.0 */ -return new class implements ServiceProviderInterface -{ +return new class () implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * diff --git a/administrator/components/com_content/src/Controller/ArticleController.php b/administrator/components/com_content/src/Controller/ArticleController.php index ea7ca17803f2b..32d8b6df8c440 100644 --- a/administrator/components/com_content/src/Controller/ArticleController.php +++ b/administrator/components/com_content/src/Controller/ArticleController.php @@ -77,16 +77,17 @@ protected function postSaveHook(BaseDatabaseModel $model, $validData = []) $link = 'index.php?option=com_content&view=article'; $type = 'component'; - $editState['id'] = $id; - $editState['link'] = $link; - $editState['title'] = $model->getItem($id)->title; - $editState['type'] = $type; + $editState['id'] = $id; + $editState['link'] = $link; + $editState['title'] = $model->getItem($id)->title; + $editState['type'] = $type; $editState['request']['id'] = $id; $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)); } @@ -127,7 +128,7 @@ protected function allowAdd($data = []) protected function allowEdit($data = [], $key = 'id') { $recordId = (int) isset($data[$key]) ? $data[$key] : 0; - $user = $this->app->getIdentity(); + $user = $this->app->getIdentity(); // Zero record (id:0), return component edit permission by calling parent controller method if (!$recordId) { diff --git a/administrator/components/com_content/src/Controller/ArticlesController.php b/administrator/components/com_content/src/Controller/ArticlesController.php index 39f1df15dcceb..55195d1ef86c0 100644 --- a/administrator/components/com_content/src/Controller/ArticlesController.php +++ b/administrator/components/com_content/src/Controller/ArticlesController.php @@ -153,7 +153,7 @@ public function getQuickiconContent() $result['amount'] = $amount; $result['sronly'] = Text::plural('COM_CONTENT_N_QUICKICON_SRONLY', $amount); - $result['name'] = Text::plural('COM_CONTENT_N_QUICKICON', $amount); + $result['name'] = Text::plural('COM_CONTENT_N_QUICKICON', $amount); echo new JsonResponse($result); } diff --git a/administrator/components/com_content/src/Controller/FeaturedController.php b/administrator/components/com_content/src/Controller/FeaturedController.php index 2e30fe8a45deb..323ecfe771517 100644 --- a/administrator/components/com_content/src/Controller/FeaturedController.php +++ b/administrator/components/com_content/src/Controller/FeaturedController.php @@ -120,7 +120,7 @@ public function getQuickiconContent() $result['amount'] = $amount; $result['sronly'] = Text::plural('COM_CONTENT_FEATURED_N_QUICKICON_SRONLY', $amount); - $result['name'] = Text::plural('COM_CONTENT_FEATURED_N_QUICKICON', $amount); + $result['name'] = Text::plural('COM_CONTENT_FEATURED_N_QUICKICON', $amount); echo new JsonResponse($result); } diff --git a/administrator/components/com_content/src/Event/Model/FeatureEvent.php b/administrator/components/com_content/src/Event/Model/FeatureEvent.php index 8c5d23fe87c3d..ca435ace28424 100644 --- a/administrator/components/com_content/src/Event/Model/FeatureEvent.php +++ b/administrator/components/com_content/src/Event/Model/FeatureEvent.php @@ -82,7 +82,7 @@ public function __construct($name, array $arguments = []) */ public function setAbort(string $reason) { - $this->arguments['abort'] = true; + $this->arguments['abort'] = true; $this->arguments['abortReason'] = $reason; } } diff --git a/administrator/components/com_content/src/Extension/ContentComponent.php b/administrator/components/com_content/src/Extension/ContentComponent.php index 7da0a914f570b..645190e2cd4e1 100644 --- a/administrator/components/com_content/src/Extension/ContentComponent.php +++ b/administrator/components/com_content/src/Extension/ContentComponent.php @@ -64,7 +64,7 @@ class ContentComponent extends MVCComponent implements /** @var array Supported functionality */ protected $supportedFunctionality = [ 'core.featured' => true, - 'core.state' => true, + 'core.state' => true, ]; /** @@ -175,7 +175,7 @@ public function getContexts(): array $contexts = [ 'com_content.article' => Text::_('COM_CONTENT'), - 'com_content.categories' => Text::_('JCATEGORY') + 'com_content.categories' => Text::_('JCATEGORY'), ]; return $contexts; @@ -193,7 +193,7 @@ public function getWorkflowContexts(): array Factory::getLanguage()->load('com_content', JPATH_ADMINISTRATOR); $contexts = [ - 'com_content.article' => Text::_('COM_CONTENT') + 'com_content.article' => Text::_('COM_CONTENT'), ]; return $contexts; @@ -299,12 +299,12 @@ public function filterTransitions(array $transitions, int $pk): array public function countItems(array $items, string $section) { $config = (object) [ - 'related_tbl' => 'content', - 'state_col' => 'state', - 'group_col' => 'catid', - 'relation_type' => 'category_or_group', - 'uses_workflows' => true, - 'workflows_component' => 'com_content' + '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); diff --git a/administrator/components/com_content/src/Field/Modal/ArticleField.php b/administrator/components/com_content/src/Field/Modal/ArticleField.php index e0ea6b0750c99..51dd6eee61a67 100644 --- a/administrator/components/com_content/src/Field/Modal/ArticleField.php +++ b/administrator/components/com_content/src/Field/Modal/ArticleField.php @@ -99,7 +99,7 @@ protected function getInput() if (isset($this->element['language'])) { $linkArticles .= '&forcedLanguage=' . $this->element['language']; - $linkArticle .= '&forcedLanguage=' . $this->element['language']; + $linkArticle .= '&forcedLanguage=' . $this->element['language']; $modalTitle = Text::_('COM_CONTENT_SELECT_AN_ARTICLE') . ' — ' . $this->element['label']; } else { $modalTitle = Text::_('COM_CONTENT_SELECT_AN_ARTICLE'); @@ -189,7 +189,7 @@ protected function getInput() // Propagate article button if ($allowPropagate && count($languages) > 2) { // Strip off language tag at the end - $tagLength = (int) strlen($this->element['language']); + $tagLength = (int) strlen($this->element['language']); $callbackFunctionStem = substr("jSelectArticle_" . $this->id, 0, -$tagLength); $html .= ' $modalTitle, - 'url' => $urlSelect, - 'height' => '400px', - 'width' => '800px', - 'bodyHeight' => 70, - 'modalWidth' => 80, - 'footer' => '', ] ); diff --git a/administrator/components/com_content/src/Helper/AssociationsHelper.php b/administrator/components/com_content/src/Helper/AssociationsHelper.php index 715571998acce..89f816a6c6240 100644 --- a/administrator/components/com_content/src/Helper/AssociationsHelper.php +++ b/administrator/components/com_content/src/Helper/AssociationsHelper.php @@ -161,14 +161,14 @@ public function getType($typeName = '') if (in_array($typeName, $this->itemTypes)) { switch ($typeName) { case 'article': - $support['state'] = true; - $support['acl'] = true; - $support['checkout'] = true; - $support['category'] = true; + $support['state'] = true; + $support['acl'] = true; + $support['checkout'] = true; + $support['category'] = true; $support['save2copy'] = true; $tables = [ - 'a' => '#__content' + 'a' => '#__content', ]; $title = 'article'; @@ -176,18 +176,18 @@ public function getType($typeName = '') case 'category': $fields['created_user_id'] = 'a.created_user_id'; - $fields['ordering'] = 'a.lft'; - $fields['level'] = 'a.level'; - $fields['catid'] = ''; - $fields['state'] = 'a.published'; + $fields['ordering'] = 'a.lft'; + $fields['level'] = 'a.level'; + $fields['catid'] = ''; + $fields['state'] = 'a.published'; - $support['state'] = true; - $support['acl'] = true; + $support['state'] = true; + $support['acl'] = true; $support['checkout'] = true; - $support['level'] = true; + $support['level'] = true; $tables = [ - 'a' => '#__categories' + 'a' => '#__categories', ]; $title = 'category'; @@ -200,7 +200,7 @@ public function getType($typeName = '') 'support' => $support, 'tables' => $tables, 'joins' => $joins, - 'title' => $title + 'title' => $title, ]; } } diff --git a/administrator/components/com_content/src/Model/ArticleModel.php b/administrator/components/com_content/src/Model/ArticleModel.php index 5b0d329a0beb8..c8432af57227f 100644 --- a/administrator/components/com_content/src/Model/ArticleModel.php +++ b/administrator/components/com_content/src/Model/ArticleModel.php @@ -138,7 +138,7 @@ protected function cleanupPostBatchCopy(TableInterface $table, $newId, $oldId) { // Check if the article was featured and update the #__content_frontpage table if ($table->featured == 1) { - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true) ->select( [ @@ -160,8 +160,8 @@ protected function cleanupPostBatchCopy(TableInterface $table, $newId, $oldId) ->bind(':featuredUp', $featured->featured_up, $featured->featured_up ? ParameterType::STRING : ParameterType::NULL) ->bind(':featuredDown', $featured->featured_down, $featured->featured_down ? ParameterType::STRING : ParameterType::NULL); - $db->setQuery($query); - $db->execute(); + $db->setQuery($query); + $db->execute(); } } @@ -199,11 +199,11 @@ protected function batchMove($value, $pks, $contexts) { if (empty($this->batchSet)) { // Set some needed variables. - $this->user = $this->getCurrentUser(); - $this->table = $this->getTable(); + $this->user = $this->getCurrentUser(); + $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new UCMType(); - $this->type = $this->contentType->getTypeByTable($this->tableClassName); + $this->contentType = new UCMType(); + $this->type = $this->contentType->getTypeByTable($this->tableClassName); } $categoryId = (int) $value; @@ -382,19 +382,19 @@ public function getItem($pk = null) { if ($item = parent::getItem($pk)) { // Convert the params field to an array. - $registry = new Registry($item->attribs); + $registry = new Registry($item->attribs); $item->attribs = $registry->toArray(); // Convert the metadata field to an array. - $registry = new Registry($item->metadata); + $registry = new Registry($item->metadata); $item->metadata = $registry->toArray(); // Convert the images field to an array. - $registry = new Registry($item->images); + $registry = new Registry($item->images); $item->images = $registry->toArray(); // Convert the urls field to an array. - $registry = new Registry($item->urls); + $registry = new Registry($item->urls); $item->urls = $registry->toArray(); $item->articletext = ($item->fulltext !== null && trim($item->fulltext) != '') ? $item->introtext . '
' . $item->fulltext : $item->introtext; @@ -408,7 +408,7 @@ public function getItem($pk = null) if ($item->featured) { // Get featured dates. - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true) ->select( [ @@ -570,7 +570,7 @@ public function getForm($data = [], $loadData = true) protected function loadFormData() { // Check the session for previously entered form data. - $app = Factory::getApplication(); + $app = Factory::getApplication(); $data = $app->getUserState('com_content.edit.article.data', []); if (empty($data)) { @@ -745,8 +745,8 @@ public function save($data) if ($data['title'] == $origTable->title) { list($title, $alias) = $this->generateNewTitle($data['catid'], $data['alias'], $data['title']); - $data['title'] = $title; - $data['alias'] = $alias; + $data['title'] = $title; + $data['alias'] = $alias; } elseif ($data['alias'] == $origTable->alias) { $data['alias'] = ''; } @@ -768,7 +768,7 @@ public function save($data) } list($title, $alias) = $this->generateNewTitle($data['catid'], $data['alias'], $data['title']); - $data['alias'] = $alias; + $data['alias'] = $alias; if (isset($msg)) { $app->enqueueMessage($msg, 'warning'); @@ -861,7 +861,7 @@ public function featured($pks, $value = 0, $featuredUp = null, $featuredDown = n } try { - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true) ->update($db->quoteName('#__content')) ->set($db->quoteName('featured') . ' = :featured') @@ -1006,7 +1006,7 @@ protected function preprocessForm(Form $form, $data, $group = 'content') if (count($languages) > 1) { $addform = new \SimpleXMLElement(''); - $fields = $addform->addChild('fields'); + $fields = $addform->addChild('fields'); $fields->addAttribute('name', 'associations'); $fieldset = $fields->addChild('fieldset'); $fieldset->addAttribute('name', 'item_associations'); @@ -1093,7 +1093,7 @@ public function delete(&$pks) if ($return) { // Now check to see if this articles was featured if so delete it from the #__content_frontpage table - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true) ->delete($db->quoteName('#__content_frontpage')) ->whereIn($db->quoteName('content_id'), $pks); diff --git a/administrator/components/com_content/src/Model/ArticlesModel.php b/administrator/components/com_content/src/Model/ArticlesModel.php index 286612e0396c0..f8dd2bdf76bb8 100644 --- a/administrator/components/com_content/src/Model/ArticlesModel.php +++ b/administrator/components/com_content/src/Model/ArticlesModel.php @@ -72,7 +72,7 @@ public function __construct($config = []) 'tag', 'rating_count', 'rating', 'stage', 'wa.stage_id', - 'ws.title' + 'ws.title', ]; if (Associations::isEnabled()) { @@ -393,8 +393,8 @@ protected function getListQuery() // Case: Using both categories filter and by level filter if (count($categoryId)) { - $categoryId = ArrayHelper::toInteger($categoryId); - $categoryTable = Table::getInstance('Category', 'JTable'); + $categoryId = ArrayHelper::toInteger($categoryId); + $categoryTable = Table::getInstance('Category', 'JTable'); $subCatItemsWhere = []; foreach ($categoryId as $key => $filter_catid) { @@ -431,13 +431,13 @@ protected function getListQuery() if (is_numeric($authorId)) { $authorId = (int) $authorId; - $type = $this->getState('filter.author_id.include', true) ? ' = ' : ' <> '; + $type = $this->getState('filter.author_id.include', true) ? ' = ' : ' <> '; $query->where($db->quoteName('a.created_by') . $type . ':authorId') ->bind(':authorId', $authorId, ParameterType::INTEGER); } elseif (is_array($authorId)) { // Check to see if by_me is in the array if (\in_array('by_me', $authorId)) { - // Replace by_me with the current user id in the array + // Replace by_me with the current user id in the array $authorId['by_me'] = $user->id; } @@ -651,7 +651,7 @@ public function getItems() $item->typeAlias = 'com_content.article'; if (isset($item->metadata)) { - $registry = new Registry($item->metadata); + $registry = new Registry($item->metadata); $item->metadata = $registry->toArray(); } } diff --git a/administrator/components/com_content/src/Service/HTML/AdministratorService.php b/administrator/components/com_content/src/Service/HTML/AdministratorService.php index 5616c632a173a..00eb37912f1b5 100644 --- a/administrator/components/com_content/src/Service/HTML/AdministratorService.php +++ b/administrator/components/com_content/src/Service/HTML/AdministratorService.php @@ -50,7 +50,7 @@ public function association($articleid) } // Get the associated menu items - $db = Factory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true) ->select( [ @@ -78,7 +78,7 @@ public function association($articleid) } if ($items) { - $languages = LanguageHelper::getContentLanguages([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 87aa71182ec73..9762da67717af 100644 --- a/administrator/components/com_content/src/Service/HTML/Icon.php +++ b/administrator/components/com_content/src/Service/HTML/Icon.php @@ -115,7 +115,7 @@ public function edit($article, $params, $attribs = [], $legacy = false) $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); + $output = HTMLHelper::_('link', '#', $text, $attribs); return $output; } @@ -132,7 +132,7 @@ public function edit($article, $params, $attribs = [], $legacy = false) $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); + $output = HTMLHelper::_('link', Route::_($url), $text, $attribs); return $output; } diff --git a/administrator/components/com_content/src/View/Articles/HtmlView.php b/administrator/components/com_content/src/View/Articles/HtmlView.php index 9d7645c18de27..597138b4aec3f 100644 --- a/administrator/components/com_content/src/View/Articles/HtmlView.php +++ b/administrator/components/com_content/src/View/Articles/HtmlView.php @@ -179,10 +179,10 @@ protected function addToolbar() ->text('COM_CONTENT_RUN_TRANSITIONS') ->buttonClass('text-center py-2 h3'); - $cmd = "Joomla.submitbutton('articles.runTransition');"; + $cmd = "Joomla.submitbutton('articles.runTransition');"; $messages = "{error: [Joomla.JText._('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST')]}"; - $alert = 'Joomla.renderMessages(' . $messages . ')'; - $cmd = 'if (document.adminForm.boxchecked.value == 0) { ' . $alert . ' } else { ' . $cmd . ' }'; + $alert = 'Joomla.renderMessages(' . $messages . ')'; + $cmd = 'if (document.adminForm.boxchecked.value == 0) { ' . $alert . ' } else { ' . $cmd . ' }'; foreach ($this->transitions as $transition) { $childBar->standardButton('transition', $transition['text']) diff --git a/administrator/components/com_content/src/View/Featured/HtmlView.php b/administrator/components/com_content/src/View/Featured/HtmlView.php index aaa4b8a5d9972..8ecb7a5510a1d 100644 --- a/administrator/components/com_content/src/View/Featured/HtmlView.php +++ b/administrator/components/com_content/src/View/Featured/HtmlView.php @@ -160,10 +160,10 @@ protected function addToolbar() $childBar->separatorButton('transition-headline', 'COM_CONTENT_RUN_TRANSITIONS') ->buttonClass('text-center py-2 h3'); - $cmd = "Joomla.submitbutton('articles.runTransition');"; + $cmd = "Joomla.submitbutton('articles.runTransition');"; $messages = "{error: [Joomla.JText._('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST')]}"; - $alert = 'Joomla.renderMessages(' . $messages . ')'; - $cmd = 'if (document.adminForm.boxchecked.value == 0) { ' . $alert . ' } else { ' . $cmd . ' }'; + $alert = 'Joomla.renderMessages(' . $messages . ')'; + $cmd = 'if (document.adminForm.boxchecked.value == 0) { ' . $alert . ' } else { ' . $cmd . ' }'; foreach ($this->transitions as $transition) { $childBar->standardButton('transition', $transition['text']) diff --git a/administrator/components/com_contenthistory/services/provider.php b/administrator/components/com_contenthistory/services/provider.php index b3c3ca13fa596..5bbd3da59e8d9 100644 --- a/administrator/components/com_contenthistory/services/provider.php +++ b/administrator/components/com_contenthistory/services/provider.php @@ -24,8 +24,7 @@ * * @since 4.0.0 */ -return new class implements ServiceProviderInterface -{ +return new class () implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * diff --git a/administrator/components/com_contenthistory/src/Helper/ContenthistoryHelper.php b/administrator/components/com_contenthistory/src/Helper/ContenthistoryHelper.php index 253513ec12274..db8928383ae5a 100644 --- a/administrator/components/com_contenthistory/src/Helper/ContenthistoryHelper.php +++ b/administrator/components/com_contenthistory/src/Helper/ContenthistoryHelper.php @@ -102,8 +102,8 @@ public static function decodeFields($jsonString) */ public static function getFormValues($object, ContentType $typesTable) { - $labels = []; - $values = []; + $labels = []; + $values = []; $expandedObjectArray = static::createObjectArray($object); static::loadLanguageFiles($typesTable->type_alias); @@ -140,7 +140,7 @@ public static function getFormValues($object, ContentType $typesTable) } } - $result = new \stdClass(); + $result = new \stdClass(); $result->labels = $labels; $result->values = $values; @@ -165,10 +165,10 @@ public static function getFormFile(ContentType $typesTable) $result = JPATH_ROOT . '/' . $options->formFile; } else { $aliasArray = explode('.', $typesTable->type_alias); - $component = ($aliasArray[1] == 'category') ? 'com_categories' : $aliasArray[0]; - $path = Folder::makeSafe(JPATH_ADMINISTRATOR . '/components/' . $component . '/models/forms/'); + $component = ($aliasArray[1] == 'category') ? 'com_categories' : $aliasArray[0]; + $path = Folder::makeSafe(JPATH_ADMINISTRATOR . '/components/' . $component . '/models/forms/'); array_shift($aliasArray); - $file = File::makeSafe(implode('.', $aliasArray) . '.xml'); + $file = File::makeSafe(implode('.', $aliasArray) . '.xml'); $result = File::exists($path . $file) ? $path . $file : false; } @@ -248,7 +248,7 @@ public static function loadLanguageFiles($typeAlias) if (is_array($aliasArray) && count($aliasArray) == 2) { $component = ($aliasArray[1] == 'category') ? 'com_categories' : $aliasArray[0]; - $lang = Factory::getLanguage(); + $lang = Factory::getLanguage(); /** * Loading language file from the administrator/language directory then @@ -287,8 +287,8 @@ public static function mergeLabels($object, $formValues) $valuesArray = $formValues->values; foreach ($object as $name => $value) { - $result->$name = new \stdClass(); - $result->$name->name = $name; + $result->$name = new \stdClass(); + $result->$name->name = $name; $result->$name->value = $valuesArray[$name] ?? $value; $result->$name->label = $labelsArray[$name] ?? $name; @@ -296,11 +296,11 @@ public static function mergeLabels($object, $formValues) $subObject = new \stdClass(); foreach ($value as $subName => $subValue) { - $subObject->$subName = new \stdClass(); - $subObject->$subName->name = $subName; + $subObject->$subName = new \stdClass(); + $subObject->$subName->name = $subName; $subObject->$subName->value = $valuesArray[$subName] ?? $subValue; $subObject->$subName->label = $labelsArray[$subName] ?? $subName; - $result->$name->value = $subObject; + $result->$name->value = $subObject; } } } @@ -319,15 +319,15 @@ public static function mergeLabels($object, $formValues) */ public static function prepareData(ContentHistory $table) { - $object = static::decodeFields($table->version_data); + $object = static::decodeFields($table->version_data); $typesTable = Table::getInstance('ContentType', 'Joomla\\CMS\\Table\\'); - $typeAlias = explode('.', $table->item_id); + $typeAlias = explode('.', $table->item_id); array_pop($typeAlias); $typesTable->load(['type_alias' => implode('.', $typeAlias)]); $formValues = static::getFormValues($object, $typesTable); - $object = static::mergeLabels($object, $formValues); - $object = static::hideFields($object, $typesTable); - $object = static::processLookupFields($object, $typesTable); + $object = static::mergeLabels($object, $formValues); + $object = static::hideFields($object, $typesTable); + $object = static::processLookupFields($object, $typesTable); return $object; } @@ -349,7 +349,7 @@ public static function processLookupFields($object, ContentType $typesTable) if (isset($options->displayLookup) && is_array($options->displayLookup)) { foreach ($options->displayLookup as $lookup) { $sourceColumn = $lookup->sourceColumn ?? false; - $sourceValue = $object->$sourceColumn->value ?? false; + $sourceValue = $object->$sourceColumn->value ?? false; if ($sourceColumn && $sourceValue && ($lookupValue = static::getLookupValue($lookup, $sourceValue))) { $object->$sourceColumn->value = $lookupValue; diff --git a/administrator/components/com_contenthistory/src/Model/CompareModel.php b/administrator/components/com_contenthistory/src/Model/CompareModel.php index 364fbedb0c090..1ca5b72bfa350 100644 --- a/administrator/components/com_contenthistory/src/Model/CompareModel.php +++ b/administrator/components/com_contenthistory/src/Model/CompareModel.php @@ -92,8 +92,8 @@ public function getItems() $nullDate = $this->getDatabase()->getNullDate(); foreach ([$table1, $table2] as $table) { - $object = new \stdClass(); - $object->data = ContenthistoryHelper::prepareData($table); + $object = new \stdClass(); + $object->data = ContenthistoryHelper::prepareData($table); $object->version_note = $table->version_note; // Let's use custom calendars when present @@ -172,11 +172,11 @@ protected function canEdit($record) $contentTypeTable = $this->getTable('ContentType'); $typeAlias = explode('.', $record->item_id); - $id = array_pop($typeAlias); + $id = array_pop($typeAlias); $typeAlias = implode('.', $typeAlias); $contentTypeTable->load(['type_alias' => $typeAlias]); $typeEditables = (array) Factory::getApplication()->getUserState(str_replace('.', '.edit.', $contentTypeTable->type_alias) . '.id'); - $result = in_array((int) $id, $typeEditables); + $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 e5bd9f8eae70f..71a93c5a31c33 100644 --- a/administrator/components/com_contenthistory/src/Model/HistoryModel.php +++ b/administrator/components/com_contenthistory/src/Model/HistoryModel.php @@ -91,11 +91,11 @@ protected function canEdit($record) $contentTypeTable = $this->getTable('ContentType'); $typeAlias = explode('.', $record->item_id); - $id = array_pop($typeAlias); + $id = array_pop($typeAlias); $typeAlias = implode('.', $typeAlias); $contentTypeTable->load(['type_alias' => $typeAlias]); $typeEditables = (array) Factory::getApplication()->getUserState(str_replace('.', '.edit.', $contentTypeTable->type_alias) . '.id'); - $result = in_array((int) $id, $typeEditables); + $result = in_array((int) $id, $typeEditables); return $result; } @@ -126,7 +126,7 @@ protected function canDelete($record) */ public function delete(&$pks) { - $pks = (array) $pks; + $pks = (array) $pks; $table = $this->getTable(); // Iterate the items to delete each one. @@ -191,7 +191,7 @@ public function delete(&$pks) public function getItems() { $items = parent::getItems(); - $user = $this->getCurrentUser(); + $user = $this->getCurrentUser(); if ($items === false) { return false; @@ -236,7 +236,7 @@ public function getTable($type = 'ContentHistory', $prefix = 'Joomla\\CMS\\Table */ public function keep(&$pks) { - $pks = (array) $pks; + $pks = (array) $pks; $table = $this->getTable(); // Iterate the items to delete each one. @@ -300,7 +300,7 @@ public function keep(&$pks) */ protected function populateState($ordering = 'h.save_date', $direction = 'DESC') { - $input = Factory::getApplication()->getInput(); + $input = Factory::getApplication()->getInput(); $itemId = $input->get('item_id', '', 'string'); $this->setState('item_id', $itemId); @@ -358,7 +358,7 @@ protected function getListQuery() ); // Add the list ordering clause. - $orderCol = $this->state->get('list.ordering'); + $orderCol = $this->state->get('list.ordering'); $orderDirn = $this->state->get('list.direction'); $query->order($db->quoteName($orderCol) . $orderDirn); @@ -386,7 +386,7 @@ protected function getSha1Hash() $helper = new CMSHelper(); $dataObject = $helper->getDataObject($contentTable); - $result = $this->getTable('ContentHistory')->getSha1(json_encode($dataObject), $typeTable); + $result = $this->getTable('ContentHistory')->getSha1(json_encode($dataObject), $typeTable); } return $result; diff --git a/administrator/components/com_contenthistory/src/Model/PreviewModel.php b/administrator/components/com_contenthistory/src/Model/PreviewModel.php index a891d9bb68977..ef2b063dacb77 100644 --- a/administrator/components/com_contenthistory/src/Model/PreviewModel.php +++ b/administrator/components/com_contenthistory/src/Model/PreviewModel.php @@ -45,7 +45,7 @@ class PreviewModel extends ItemModel public function getItem($pk = null) { /** @var ContentHistory $table */ - $table = $this->getTable('ContentHistory'); + $table = $this->getTable('ContentHistory'); $versionId = Factory::getApplication()->getInput()->getInt('version_id'); if (!$versionId || \is_array($versionId) || !$table->load($versionId)) { @@ -59,9 +59,9 @@ public function getItem($pk = null) throw new NotAllowed(Text::_('JERROR_ALERTNOAUTHOR'), 403); } - $result = new \stdClass(); + $result = new \stdClass(); $result->version_note = $table->version_note; - $result->data = ContenthistoryHelper::prepareData($table); + $result->data = ContenthistoryHelper::prepareData($table); // Let's use custom calendars when present $result->save_date = HTMLHelper::_('date', $table->save_date, Text::_('DATE_FORMAT_LC6')); @@ -138,10 +138,10 @@ protected function canEdit($record) $contentTypeTable = $this->getTable('ContentType'); $typeAlias = explode('.', $record->item_id); - $id = array_pop($typeAlias); + $id = array_pop($typeAlias); $typeAlias = implode('.', $typeAlias); - $typeEditables = (array) Factory::getApplication()->getUserState(str_replace('.', '.edit.', $contentTypeTable->type_alias) . '.id'); - $result = in_array((int) $id, $typeEditables); + $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/View/History/HtmlView.php b/administrator/components/com_contenthistory/src/View/History/HtmlView.php index 272cbfaa04785..331479595f0cc 100644 --- a/administrator/components/com_contenthistory/src/View/History/HtmlView.php +++ b/administrator/components/com_contenthistory/src/View/History/HtmlView.php @@ -70,8 +70,8 @@ class HtmlView extends BaseHtmlView */ public function display($tpl = null) { - $this->state = $this->get('State'); - $this->items = $this->get('Items'); + $this->state = $this->get('State'); + $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); // Check for errors. diff --git a/administrator/components/com_cpanel/services/provider.php b/administrator/components/com_cpanel/services/provider.php index 064bc2bdf3e80..e4aa0afec8d58 100644 --- a/administrator/components/com_cpanel/services/provider.php +++ b/administrator/components/com_cpanel/services/provider.php @@ -24,8 +24,7 @@ * * @since 4.0.0 */ -return new class implements ServiceProviderInterface -{ +return new class () implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * diff --git a/administrator/components/com_cpanel/src/View/Cpanel/HtmlView.php b/administrator/components/com_cpanel/src/View/Cpanel/HtmlView.php index 0ececde72ff50..197e555b38ee0 100644 --- a/administrator/components/com_cpanel/src/View/Cpanel/HtmlView.php +++ b/administrator/components/com_cpanel/src/View/Cpanel/HtmlView.php @@ -103,8 +103,8 @@ public function display($tpl = null) $prefix = strtoupper($component) . '_DASHBOARD'; $sectionkey = !empty($parts[1]) ? '_' . strtoupper($parts[1]) : ''; - $key = $prefix . $sectionkey . '_TITLE'; - $keyIcon = $prefix . $sectionkey . '_ICON'; + $key = $prefix . $sectionkey . '_TITLE'; + $keyIcon = $prefix . $sectionkey . '_ICON'; // Search for a component title if ($lang->hasKey($key)) { @@ -141,7 +141,7 @@ public function display($tpl = null) } else { // Home Dashboard $title = Text::_('COM_CPANEL_DASHBOARD_BASE_TITLE'); - $icon = 'icon-home'; + $icon = 'icon-home'; } // Set toolbar items for the page @@ -150,9 +150,9 @@ public function display($tpl = null) // Display the cpanel modules $this->position = $position ? 'cpanel-' . $position : 'cpanel'; - $this->modules = ModuleHelper::getModules($this->position); + $this->modules = ModuleHelper::getModules($this->position); - $quickicons = $position ? 'icon-' . $position : 'icon'; + $quickicons = $position ? 'icon-' . $position : 'icon'; $this->quickicons = ModuleHelper::getModules($quickicons); parent::display($tpl); diff --git a/administrator/components/com_fields/services/provider.php b/administrator/components/com_fields/services/provider.php index bb7fc5dce97b2..10d4e444bac7f 100644 --- a/administrator/components/com_fields/services/provider.php +++ b/administrator/components/com_fields/services/provider.php @@ -26,8 +26,7 @@ * * @since 4.0.0 */ -return new class implements ServiceProviderInterface -{ +return new class () implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * diff --git a/administrator/components/com_fields/src/Controller/FieldController.php b/administrator/components/com_fields/src/Controller/FieldController.php index 3c545d869e2fe..7e7e733a6b0c0 100644 --- a/administrator/components/com_fields/src/Controller/FieldController.php +++ b/administrator/components/com_fields/src/Controller/FieldController.php @@ -65,8 +65,8 @@ public function __construct($config = [], MVCFactoryInterface $factory = null, $ parent::__construct($config, $factory, $app, $input); $this->internalContext = $this->app->getUserStateFromRequest('com_fields.fields.context', 'context', 'com_content.article', 'CMD'); - $parts = FieldsHelper::extract($this->internalContext); - $this->component = $parts ? $parts[0] : null; + $parts = FieldsHelper::extract($this->internalContext); + $this->component = $parts ? $parts[0] : null; } /** diff --git a/administrator/components/com_fields/src/Controller/GroupController.php b/administrator/components/com_fields/src/Controller/GroupController.php index c35621379c1bc..7aba400b07271 100644 --- a/administrator/components/com_fields/src/Controller/GroupController.php +++ b/administrator/components/com_fields/src/Controller/GroupController.php @@ -118,7 +118,7 @@ protected function allowAdd($data = []) protected function allowEdit($data = [], $key = 'parent_id') { $recordId = (int) isset($data[$key]) ? $data[$key] : 0; - $user = $this->app->getIdentity(); + $user = $this->app->getIdentity(); // Zero record (parent_id:0), return component edit permission by calling parent controller method if (!$recordId) { diff --git a/administrator/components/com_fields/src/Field/ComponentsFieldgroupField.php b/administrator/components/com_fields/src/Field/ComponentsFieldgroupField.php index 8f226b2a5efc2..758ec61af2a4e 100644 --- a/administrator/components/com_fields/src/Field/ComponentsFieldgroupField.php +++ b/administrator/components/com_fields/src/Field/ComponentsFieldgroupField.php @@ -95,10 +95,10 @@ protected function getOptions() $contexts = $c->getContexts(); foreach ($contexts as $context) { - $newOption = new \stdClass(); + $newOption = new \stdClass(); $newOption->value = strtolower($component->value . '.' . $context); - $newOption->text = $component->text . ' - ' . Text::_($context); - $options[] = $newOption; + $newOption->text = $component->text . ' - ' . Text::_($context); + $options[] = $newOption; } } else { $options[] = $component; diff --git a/administrator/components/com_fields/src/Field/ComponentsFieldsField.php b/administrator/components/com_fields/src/Field/ComponentsFieldsField.php index f0620c2525ec1..6580adff51377 100644 --- a/administrator/components/com_fields/src/Field/ComponentsFieldsField.php +++ b/administrator/components/com_fields/src/Field/ComponentsFieldsField.php @@ -95,10 +95,10 @@ protected function getOptions() $contexts = $c->getContexts(); foreach ($contexts as $context) { - $newOption = new \stdClass(); + $newOption = new \stdClass(); $newOption->value = strtolower($component->value . '.' . $context); - $newOption->text = $component->text . ' - ' . Text::_($context); - $options[] = $newOption; + $newOption->text = $component->text . ' - ' . Text::_($context); + $options[] = $newOption; } } else { $options[] = $component; diff --git a/administrator/components/com_fields/src/Field/FieldLayoutField.php b/administrator/components/com_fields/src/Field/FieldLayoutField.php index bc819de2af238..7d652577131e2 100644 --- a/administrator/components/com_fields/src/Field/FieldLayoutField.php +++ b/administrator/components/com_fields/src/Field/FieldLayoutField.php @@ -50,7 +50,7 @@ protected function getInput() if ($extension) { // Get the database object and a new query object. - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true); // Build the query. @@ -79,14 +79,14 @@ 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['_'] = []; - $groups['_']['id'] = $this->id . '__'; - $groups['_']['text'] = Text::sprintf('JOPTION_FROM_COMPONENT'); + $groups['_'] = []; + $groups['_']['id'] = $this->id . '__'; + $groups['_']['text'] = Text::sprintf('JOPTION_FROM_COMPONENT'); $groups['_']['items'] = []; foreach ($component_layouts as $i => $file) { // Add an option to the component group - $value = basename($file, '.php'); + $value = basename($file, '.php'); $component_layouts[$i] = $value; if ($value === 'render') { @@ -100,7 +100,7 @@ protected function getInput() // Loop on all templates if ($templates) { foreach ($templates as $template) { - $files = []; + $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'), @@ -125,14 +125,14 @@ protected function getInput() if (count($files)) { // Create the group for the template - $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] = []; + $groups[$template->name]['id'] = $this->id . '_' . $template->element; + $groups[$template->name]['text'] = Text::sprintf('JOPTION_FROM_TEMPLATE', $template->name); $groups[$template->name]['items'] = []; foreach ($files as $file) { // Add an option to the template group - $value = basename($file, '.php'); + $value = basename($file, '.php'); $groups[$template->name]['items'][] = HTMLHelper::_('select.option', $value, $value); } } diff --git a/administrator/components/com_fields/src/Field/FieldgroupsField.php b/administrator/components/com_fields/src/Field/FieldgroupsField.php index 7b6c01c41ac9e..873a910e1a043 100644 --- a/administrator/components/com_fields/src/Field/FieldgroupsField.php +++ b/administrator/components/com_fields/src/Field/FieldgroupsField.php @@ -39,7 +39,7 @@ class FieldgroupsField extends ListField */ protected function getOptions() { - $context = (string) $this->element['context']; + $context = (string) $this->element['context']; $states = $this->element['state'] ?: '0,1'; $states = ArrayHelper::toInteger(explode(',', $states)); diff --git a/administrator/components/com_fields/src/Helper/FieldsHelper.php b/administrator/components/com_fields/src/Helper/FieldsHelper.php index e0e15f800d093..4c7ca6947bb8f 100644 --- a/administrator/components/com_fields/src/Helper/FieldsHelper.php +++ b/administrator/components/com_fields/src/Helper/FieldsHelper.php @@ -342,7 +342,7 @@ public static function prepareForm($context, Form $form, $data) $fieldTypes = self::getFieldTypes(); // Creating the dom - $xml = new \DOMDocument('1.0', 'UTF-8'); + $xml = new \DOMDocument('1.0', 'UTF-8'); $fieldsNode = $xml->appendChild(new \DOMElement('form'))->appendChild(new \DOMElement('fields')); $fieldsNode->setAttribute('name', 'com_fields'); @@ -381,11 +381,11 @@ public static function prepareForm($context, Form $form, $data) * have the 'default' group with id 0 which is not in the database, * so we create it virtually here. */ - $defaultGroup = new \stdClass(); - $defaultGroup->id = 0; - $defaultGroup->title = ''; + $defaultGroup = new \stdClass(); + $defaultGroup->id = 0; + $defaultGroup->title = ''; $defaultGroup->description = ''; - $iterateGroups = array_merge([$defaultGroup], $model->getItems()); + $iterateGroups = array_merge([$defaultGroup], $model->getItems()); // Looping through the groups foreach ($iterateGroups as $group) { diff --git a/administrator/components/com_fields/src/Model/FieldModel.php b/administrator/components/com_fields/src/Model/FieldModel.php index a4f866999d646..beacfa288bf1d 100644 --- a/administrator/components/com_fields/src/Model/FieldModel.php +++ b/administrator/components/com_fields/src/Model/FieldModel.php @@ -72,7 +72,7 @@ class FieldModel extends AdminModel */ protected $batch_commands = [ 'assetgroup_id' => 'batchAccess', - 'language_id' => 'batchLanguage' + 'language_id' => 'batchLanguage', ]; /** @@ -130,9 +130,9 @@ public function save($data) if ($data['title'] == $origTable->title) { list($title, $name) = $this->generateNewTitle($data['group_id'], $data['name'], $data['title']); - $data['title'] = $title; - $data['label'] = $title; - $data['name'] = $name; + $data['title'] = $title; + $data['label'] = $title; + $data['name'] = $name; } else { if ($data['name'] == $origTable->name) { $data['name'] = ''; @@ -196,7 +196,7 @@ public function save($data) $db->execute(); // Inset new assigned categories - $tuple = new \stdClass(); + $tuple = new \stdClass(); $tuple->field_id = $id; foreach ($assignedCatIds as $catId) { @@ -224,7 +224,7 @@ public function save($data) $names = array_column((array) $newParams, 'value'); $fieldId = (int) $field->id; - $query = $db->getQuery(true); + $query = $db->getQuery(true); $query->delete($db->quoteName('#__fields_values')) ->where($db->quoteName('field_id') . ' = :fieldid') ->bind(':fieldid', $fieldId, ParameterType::INTEGER); @@ -297,7 +297,7 @@ private function checkDefaultValue($data) } // Define the type either from the field or from the data - $type = $node->firstChild->getAttribute('validate') ? : $data['type']; + $type = $node->firstChild->getAttribute('validate') ?: $data['type']; // Load the rule $rule = FormHelper::loadRuleType($type); @@ -330,7 +330,7 @@ private function checkDefaultValue($data) $result = $rule->test($element, $value); // Check if the test succeeded - return $result === true ? : Text::_('COM_FIELDS_FIELD_INVALID_DEFAULT_VALUE'); + return $result === true ?: Text::_('COM_FIELDS_FIELD_INVALID_DEFAULT_VALUE'); } catch (\UnexpectedValueException $e) { return $e->getMessage(); } @@ -387,8 +387,8 @@ public function getItem($pk = null) $result->fieldparams = $registry->toArray(); } - $db = $this->getDatabase(); - $query = $db->getQuery(true); + $db = $this->getDatabase(); + $query = $db->getQuery(true); $fieldId = (int) $result->id; $query->select($db->quoteName('category_id')) ->from($db->quoteName('#__fields_categories')) @@ -441,7 +441,7 @@ protected function generateNewTitle($categoryId, $name, $title) while ($table->load(['name' => $name])) { $title = StringHelper::increment($title); - $name = StringHelper::increment($name, 'dash'); + $name = StringHelper::increment($name, 'dash'); } return [ @@ -631,7 +631,7 @@ public function setFieldValue($fieldId, $itemId, $value) $fieldId = (int) $fieldId; // Deleting the existing record as it is a reset - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true); $query->delete($db->quoteName('#__fields_values')) @@ -715,7 +715,7 @@ public function getFieldValues(array $fieldIds, $itemId) // Fill the cache when it doesn't exist if (!array_key_exists($key, $this->valueCache)) { // Create the query - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true); $query->select($db->quoteName(['field_id', 'value'])) @@ -770,7 +770,7 @@ public function getFieldValues(array $fieldIds, $itemId) public function cleanupValues($context, $itemId) { // Delete with inner join is not possible so we need to do a subquery - $db = $this->getDatabase(); + $db = $this->getDatabase(); $fieldsQuery = $db->getQuery(true); $fieldsQuery->select($db->quoteName('id')) ->from($db->quoteName('#__fields')) diff --git a/administrator/components/com_fields/src/Model/FieldsModel.php b/administrator/components/com_fields/src/Model/FieldsModel.php index 5f2d67cc6af0b..0d7fe853e97a9 100644 --- a/administrator/components/com_fields/src/Model/FieldsModel.php +++ b/administrator/components/com_fields/src/Model/FieldsModel.php @@ -61,7 +61,7 @@ public function __construct($config = [], MVCFactoryInterface $factory = null) 'group_title', 'g.title', 'category_id', 'a.category_id', 'group_id', 'a.group_id', - 'assigned_cat_ids' + 'assigned_cat_ids', ]; } @@ -193,7 +193,7 @@ protected function getListQuery() if (($categories = $this->getState('filter.assigned_cat_ids')) && $context) { $categories = (array) $categories; $categories = ArrayHelper::toInteger($categories); - $parts = FieldsHelper::extract($context); + $parts = FieldsHelper::extract($context); if ($parts) { // Get the categories for this component (and optionally this section, if available) @@ -237,7 +237,7 @@ function () use ($parts) { // Traverse the tree up to get all the fields which are attached to a parent while ($parent->getParent() && $parent->getParent()->id != 'root') { - $parent = $parent->getParent(); + $parent = $parent->getParent(); $categories[] = (int) $parent->id; } } @@ -270,7 +270,7 @@ function () use ($parts) { 'AND', [ $db->quoteName('a.group_id') . ' = 0', - $db->quoteName('g.access') . ' IN (' . implode(',', $query->bindArray($groups, ParameterType::INTEGER)) . ')' + $db->quoteName('g.access') . ' IN (' . implode(',', $query->bindArray($groups, ParameterType::INTEGER)) . ')', ], 'OR' ); @@ -308,7 +308,7 @@ function () use ($parts) { 'AND', [ $db->quoteName('a.group_id') . ' = 0', - $db->quoteName('g.state') . ' IN (' . implode(',', $query->bindArray([0, 1], ParameterType::INTEGER)) . ')' + $db->quoteName('g.state') . ' IN (' . implode(',', $query->bindArray([0, 1], ParameterType::INTEGER)) . ')', ], 'OR' ); @@ -399,7 +399,7 @@ protected function _getList($query, $limitstart = 0, $limit = 0) if (is_array($result)) { foreach ($result as $field) { $field->fieldparams = new Registry($field->fieldparams); - $field->params = new Registry($field->params); + $field->params = new Registry($field->params); } } diff --git a/administrator/components/com_fields/src/Model/GroupModel.php b/administrator/components/com_fields/src/Model/GroupModel.php index ea833d71f1bab..92f1e4c14a44a 100644 --- a/administrator/components/com_fields/src/Model/GroupModel.php +++ b/administrator/components/com_fields/src/Model/GroupModel.php @@ -44,7 +44,7 @@ class GroupModel extends AdminModel */ protected $batch_commands = [ 'assetgroup_id' => 'batchAccess', - 'language_id' => 'batchLanguage' + 'language_id' => 'batchLanguage', ]; /** @@ -99,7 +99,7 @@ public function getTable($name = 'Group', $prefix = 'Administrator', $options = public function getForm($data = [], $loadData = true) { $context = $this->getState('filter.context'); - $jinput = Factory::getApplication()->getInput(); + $jinput = Factory::getApplication()->getInput(); if (empty($context) && isset($data['context'])) { $context = $data['context']; diff --git a/administrator/components/com_fields/src/Model/GroupsModel.php b/administrator/components/com_fields/src/Model/GroupsModel.php index fdcc902a54773..4eb9c5b7b054c 100644 --- a/administrator/components/com_fields/src/Model/GroupsModel.php +++ b/administrator/components/com_fields/src/Model/GroupsModel.php @@ -127,9 +127,9 @@ protected function getStoreId($id = '') protected function getListQuery() { // Create a new query object. - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true); - $user = $this->getCurrentUser(); + $user = $this->getCurrentUser(); // Select the required fields from the table. $query->select($this->getState('list.select', 'a.*')); @@ -207,7 +207,7 @@ protected function getListQuery() // Add the list ordering clause $listOrdering = $this->getState('list.ordering', 'a.ordering'); - $listDirn = $db->escape($this->getState('list.direction', 'ASC')); + $listDirn = $db->escape($this->getState('list.direction', 'ASC')); $query->order($db->escape($listOrdering) . ' ' . $listDirn); diff --git a/administrator/components/com_fields/src/Plugin/FieldsListPlugin.php b/administrator/components/com_fields/src/Plugin/FieldsListPlugin.php index abe4e1866b15b..06ea8e62e3f36 100644 --- a/administrator/components/com_fields/src/Plugin/FieldsListPlugin.php +++ b/administrator/components/com_fields/src/Plugin/FieldsListPlugin.php @@ -46,7 +46,7 @@ public function onCustomFieldsPrepareDom($field, \DOMElement $parent, Form $form $fieldNode->setAttribute('validate', 'options'); foreach ($this->getOptionsFromField($field) as $value => $name) { - $option = new \DOMElement('option', htmlspecialchars($value, ENT_COMPAT, 'UTF-8')); + $option = new \DOMElement('option', htmlspecialchars($value, ENT_COMPAT, 'UTF-8')); $option->textContent = htmlspecialchars(Text::_($name), ENT_COMPAT, 'UTF-8'); $element = $fieldNode->appendChild($option); @@ -74,7 +74,7 @@ public function getOptionsFromField($field) $params->merge($field->fieldparams); foreach ($params->get('options', []) as $option) { - $op = (object) $option; + $op = (object) $option; $data[$op->value] = $op->name; } diff --git a/administrator/components/com_fields/src/Table/FieldTable.php b/administrator/components/com_fields/src/Table/FieldTable.php index 2d07b524be87f..eb409dc4b45d0 100644 --- a/administrator/components/com_fields/src/Table/FieldTable.php +++ b/administrator/components/com_fields/src/Table/FieldTable.php @@ -90,7 +90,7 @@ public function bind($src, $ignore = '') if (!isset($seen_customfields[$option['customfield']])) { // We haven't, so add it to the final options $seen_customfields[$option['customfield']] = true; - $options['option' . $i] = $option; + $options['option' . $i] = $option; $i++; } } @@ -175,7 +175,7 @@ public function check() if ($this->id) { // Existing item $this->modified_time = $date; - $this->modified_by = $user->get('id'); + $this->modified_by = $user->get('id'); } else { if (!(int) $this->modified_time) { $this->modified_time = $this->created_time; @@ -262,7 +262,7 @@ protected function _getAssetTitle() protected function _getAssetParentId(Table $table = null, $id = null) { $contextArray = explode('.', $this->context); - $component = $contextArray[0]; + $component = $contextArray[0]; if ($this->group_id) { $assetId = $this->getAssetId($component . '.fieldgroup.' . (int) $this->group_id); @@ -292,7 +292,7 @@ protected function _getAssetParentId(Table $table = null, $id = null) */ private function getAssetId($name) { - $db = $this->getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('id')) ->from($db->quoteName('#__assets')) diff --git a/administrator/components/com_fields/src/Table/GroupTable.php b/administrator/components/com_fields/src/Table/GroupTable.php index 61fa03e7cb95a..8658dd80621c4 100644 --- a/administrator/components/com_fields/src/Table/GroupTable.php +++ b/administrator/components/com_fields/src/Table/GroupTable.php @@ -109,7 +109,7 @@ public function check() } if ($this->id) { - $this->modified = $date; + $this->modified = $date; $this->modified_by = $user->get('id'); } else { if (!(int) $this->modified) { @@ -197,8 +197,8 @@ protected function _getAssetTitle() protected function _getAssetParentId(Table $table = null, $id = null) { $component = explode('.', $this->context); - $db = $this->getDbo(); - $query = $db->getQuery(true) + $db = $this->getDbo(); + $query = $db->getQuery(true) ->select($db->quoteName('id')) ->from($db->quoteName('#__assets')) ->where($db->quoteName('name') . ' = :name') diff --git a/administrator/components/com_finder/services/provider.php b/administrator/components/com_finder/services/provider.php index 2fc098a563e55..2e7cdbc027c31 100644 --- a/administrator/components/com_finder/services/provider.php +++ b/administrator/components/com_finder/services/provider.php @@ -27,8 +27,7 @@ * * @since 4.0.0 */ -return new class implements ServiceProviderInterface -{ +return new class () implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * diff --git a/administrator/components/com_finder/src/Controller/DisplayController.php b/administrator/components/com_finder/src/Controller/DisplayController.php index a35ece9ccf8b0..526c8901624c1 100644 --- a/administrator/components/com_finder/src/Controller/DisplayController.php +++ b/administrator/components/com_finder/src/Controller/DisplayController.php @@ -48,8 +48,8 @@ class DisplayController extends BaseController */ public function display($cachable = false, $urlparams = []) { - $view = $this->input->get('view', 'index', 'word'); - $layout = $this->input->get('layout', 'index', 'word'); + $view = $this->input->get('view', 'index', 'word'); + $layout = $this->input->get('layout', 'index', 'word'); $filterId = $this->input->get('filter_id', null, 'int'); if ($view === 'index') { @@ -57,7 +57,7 @@ public function display($cachable = false, $urlparams = []) if (!$pluginEnabled) { $finderPluginId = FinderHelper::getFinderPluginId(); - $link = HTMLHelper::_( + $link = HTMLHelper::_( 'link', '#plugin' . $finderPluginId . 'Modal', Text::_('COM_FINDER_CONTENT_PLUGIN'), diff --git a/administrator/components/com_finder/src/Controller/FilterController.php b/administrator/components/com_finder/src/Controller/FilterController.php index b48585d2f6de1..b8eb4ff522888 100644 --- a/administrator/components/com_finder/src/Controller/FilterController.php +++ b/administrator/components/com_finder/src/Controller/FilterController.php @@ -42,12 +42,12 @@ public function save($key = null, $urlVar = null) $this->checkToken(); /** @var \Joomla\Component\Finder\Administrator\Model\FilterModel $model */ - $model = $this->getModel(); - $table = $model->getTable(); - $data = $this->input->post->get('jform', [], 'array'); + $model = $this->getModel(); + $table = $model->getTable(); + $data = $this->input->post->get('jform', [], 'array'); $checkin = $table->hasField('checked_out'); $context = "$this->option.edit.$this->context"; - $task = $this->getTask(); + $task = $this->getTask(); // Determine the name of the primary key for the data. if (empty($key)) { @@ -88,7 +88,7 @@ public function save($key = null, $urlVar = null) // Reset the ID and then treat the request as for Apply. $data[$key] = 0; - $task = 'apply'; + $task = 'apply'; } // Access check. diff --git a/administrator/components/com_finder/src/Controller/IndexerController.php b/administrator/components/com_finder/src/Controller/IndexerController.php index c585da58fa169..5097500205626 100644 --- a/administrator/components/com_finder/src/Controller/IndexerController.php +++ b/administrator/components/com_finder/src/Controller/IndexerController.php @@ -50,7 +50,7 @@ public function start() $params = ComponentHelper::getParams('com_finder'); if ($params->get('enable_logging', '0')) { - $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; + $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; $options['text_file'] = 'indexer.php'; Log::addLogger($options); } @@ -84,7 +84,7 @@ public function start() $this->app->triggerEvent('onStartIndex'); // Get the indexer state. - $state = Indexer::getState(); + $state = Indexer::getState(); $state->start = 1; // Send the response. @@ -114,7 +114,7 @@ public function batch() $params = ComponentHelper::getParams('com_finder'); if ($params->get('enable_logging', '0')) { - $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; + $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; $options['text_file'] = 'indexer.php'; Log::addLogger($options); } @@ -160,7 +160,7 @@ public function batch() 'lineend' => 'unix', 'tab' => ' ', 'language' => $lang->getTag(), - 'direction' => $lang->isRtl() ? 'rtl' : 'ltr' + 'direction' => $lang->isRtl() ? 'rtl' : 'ltr', ]; // Start the indexer. @@ -172,8 +172,8 @@ public function batch() $this->app->triggerEvent('onBuildIndex'); // Get the indexer state. - $state = Indexer::getState(); - $state->start = 0; + $state = Indexer::getState(); + $state->start = 0; $state->complete = 0; // Log batch completion and memory high-water mark. @@ -223,8 +223,8 @@ public function optimize() $indexer->optimize(); // Get the indexer state. - $state = Indexer::getState(); - $state->start = 0; + $state = Indexer::getState(); + $state->start = 0; $state->complete = 1; // Send the response. @@ -253,7 +253,7 @@ public static function sendResponse($data = null) $params = ComponentHelper::getParams('com_finder'); if ($params->get('enable_logging', '0')) { - $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; + $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; $options['text_file'] = 'indexer.php'; Log::addLogger($options); } diff --git a/administrator/components/com_finder/src/Field/ContentmapField.php b/administrator/components/com_finder/src/Field/ContentmapField.php index 90916ee7635fd..c540e1bd243b4 100644 --- a/administrator/components/com_finder/src/Field/ContentmapField.php +++ b/administrator/components/com_finder/src/Field/ContentmapField.php @@ -80,7 +80,7 @@ protected function getGroups() } foreach ($parents[1] as $branch) { - $text = Text::_(LanguageHelper::branchSingular($branch->text)); + $text = Text::_(LanguageHelper::branchSingular($branch->text)); $groups[$text] = $this->prepareLevel($branch->value, $parents); } } @@ -103,7 +103,7 @@ protected function getGroups() */ private function prepareLevel($parent, $parents) { - $lang = Factory::getLanguage(); + $lang = Factory::getLanguage(); $entries = []; foreach ($parents[$parent] as $item) { @@ -112,7 +112,7 @@ private function prepareLevel($parent, $parents) if (trim($item->text, '*') === 'Language') { $text = LanguageHelper::branchLanguageTitle($item->text); } else { - $key = LanguageHelper::branchSingular($item->text); + $key = LanguageHelper::branchSingular($item->text); $text = $lang->hasKey($key) ? Text::_($key) : $item->text; } diff --git a/administrator/components/com_finder/src/Field/ContenttypesField.php b/administrator/components/com_finder/src/Field/ContenttypesField.php index 51b041bb39271..45d78df38e5be 100644 --- a/administrator/components/com_finder/src/Field/ContenttypesField.php +++ b/administrator/components/com_finder/src/Field/ContenttypesField.php @@ -65,7 +65,7 @@ public function getOptions() // Translate. foreach ($contentTypes as $contentType) { - $key = LanguageHelper::branchSingular($contentType->text); + $key = LanguageHelper::branchSingular($contentType->text); $contentType->translatedText = $lang->hasKey($key) ? Text::_($key) : $contentType->text; } diff --git a/administrator/components/com_finder/src/Field/SearchfilterField.php b/administrator/components/com_finder/src/Field/SearchfilterField.php index ecb2b16daeb77..7925b42e01ab9 100644 --- a/administrator/components/com_finder/src/Field/SearchfilterField.php +++ b/administrator/components/com_finder/src/Field/SearchfilterField.php @@ -43,7 +43,7 @@ class SearchfilterField extends ListField public function getOptions() { // Build the query. - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true) ->select('f.title AS text, f.filter_id AS value') ->from($db->quoteName('#__finder_filters') . ' AS f') diff --git a/administrator/components/com_finder/src/Helper/LanguageHelper.php b/administrator/components/com_finder/src/Helper/LanguageHelper.php index b027bd32936b8..7376fab091f20 100644 --- a/administrator/components/com_finder/src/Helper/LanguageHelper.php +++ b/administrator/components/com_finder/src/Helper/LanguageHelper.php @@ -56,7 +56,7 @@ public static function branchPlural($branchName) */ public static function branchSingular($branchName) { - $return = preg_replace('/[^a-zA-Z0-9]+/', '_', strtoupper($branchName)); + $return = preg_replace('/[^a-zA-Z0-9]+/', '_', strtoupper($branchName)); $language = Factory::getApplication()->getLanguage(); if ($language->hasKey('PLG_FINDER_QUERY_FILTER_BRANCH_S_' . $return) || JDEBUG) { @@ -123,7 +123,7 @@ public static function loadPluginLanguage() $loaded = true; // Get array of all the enabled Smart Search plugin names. - $db = Factory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true) ->select([$db->quoteName('name'), $db->quoteName('element')]) ->from($db->quoteName('#__extensions')) diff --git a/administrator/components/com_finder/src/Indexer/Adapter.php b/administrator/components/com_finder/src/Indexer/Adapter.php index 494b8f44545b0..23b46de4b5bca 100644 --- a/administrator/components/com_finder/src/Indexer/Adapter.php +++ b/administrator/components/com_finder/src/Indexer/Adapter.php @@ -178,7 +178,7 @@ public function onStartIndex() $iState->totalItems += $total; // Populate the indexer state information for the adapter. - $iState->pluginState[$this->context]['total'] = $total; + $iState->pluginState[$this->context]['total'] = $total; $iState->pluginState[$this->context]['offset'] = 0; // Set the indexer state. @@ -233,7 +233,7 @@ public function onBuildIndex() // Get the batch offset and size. $offset = (int) $aState['offset']; - $limit = (int) ($iState->batchSize - $iState->batchOffset); + $limit = (int) ($iState->batchSize - $iState->batchOffset); // Get the content items to index. $items = $this->getItems($offset, $limit); @@ -250,7 +250,7 @@ public function onBuildIndex() } // Update the indexer state. - $aState['offset'] = $offset; + $aState['offset'] = $offset; $iState->pluginState[$this->context] = $aState; Indexer::setState($iState); @@ -266,10 +266,10 @@ public function onBuildIndex() */ public function onFinderGarbageCollection() { - $db = $this->db; + $db = $this->db; $type_id = $this->getTypeId(); - $query = $db->getQuery(true); + $query = $db->getQuery(true); $subquery = $db->getQuery(true); $subquery->select('CONCAT(' . $db->quote($this->getUrl('', $this->extension, $this->layout)) . ', id)') ->from($db->quoteName($this->table)); @@ -768,7 +768,7 @@ protected function getItemMenuTitle($url) $return = null; // Set variables - $user = Factory::getUser(); + $user = Factory::getUser(); $groups = implode(',', $user->getAuthorisedViewLevels()); // Build a query to get the menu params. diff --git a/administrator/components/com_finder/src/Indexer/Helper.php b/administrator/components/com_finder/src/Indexer/Helper.php index a661a05f6ca60..2256a006ab135 100644 --- a/administrator/components/com_finder/src/Indexer/Helper.php +++ b/administrator/components/com_finder/src/Indexer/Helper.php @@ -65,13 +65,13 @@ public static function tokenize($input, $lang, $phrase = false) static $defaultLanguage; if (!$tuplecount) { - $params = ComponentHelper::getParams('com_finder'); + $params = ComponentHelper::getParams('com_finder'); $tuplecount = $params->get('tuplecount', 1); } if (is_null($multilingual)) { $multilingual = Multilanguage::isEnabled(); - $config = ComponentHelper::getParams('com_finder'); + $config = ComponentHelper::getParams('com_finder'); if ($config->get('language_default', '') == '') { $defaultLang = '*'; @@ -86,8 +86,8 @@ public static function tokenize($input, $lang, $phrase = false) * In order to not overwrite the language code of the language * object that we are using, we are cloning it here. */ - $obj = Language::getInstance($defaultLang); - $defaultLanguage = clone $obj; + $obj = Language::getInstance($defaultLang); + $defaultLanguage = clone $obj; $defaultLanguage->language = '*'; } @@ -102,7 +102,7 @@ public static function tokenize($input, $lang, $phrase = false) } $tokens = []; - $terms = $language->tokenise($input); + $terms = $language->tokenise($input); // @todo: array_filter removes any number 0's from the terms. Not sure this is entirely intended $terms = array_filter($terms); @@ -122,8 +122,8 @@ public static function tokenize($input, $lang, $phrase = false) if (isset($cache[$lang][$terms[$i]])) { $tokens[] = $cache[$lang][$terms[$i]]; } else { - $token = new Token($terms[$i], $language->language); - $tokens[] = $token; + $token = new Token($terms[$i], $language->language); + $tokens[] = $token; $cache[$lang][$terms[$i]] = $token; } } @@ -140,14 +140,14 @@ public static function tokenize($input, $lang, $phrase = false) } $temp[] = $tokens[$i + $j]->term; - $key = implode('::', $temp); + $key = implode('::', $temp); if (isset($cache[$lang][$key])) { $tokens[] = $cache[$lang][$key]; } else { - $token = new Token($temp, $language->language, $language->spacer); - $token->derived = true; - $tokens[] = $token; + $token = new Token($temp, $language->language, $language->spacer); + $token->derived = true; + $tokens[] = $token; $cache[$lang][$key] = $token; } } @@ -186,7 +186,7 @@ public static function stem($token, $lang) if (is_null($multilingual)) { $multilingual = Multilanguage::isEnabled(); - $config = ComponentHelper::getParams('com_finder'); + $config = ComponentHelper::getParams('com_finder'); if ($config->get('language_default', '') == '') { $defaultStemmer = Language::getInstance('*'); @@ -268,7 +268,7 @@ public static function isCommon($token, $lang) if (is_null($multilingual)) { $multilingual = Multilanguage::isEnabled(); - $config = ComponentHelper::getParams('com_finder'); + $config = ComponentHelper::getParams('com_finder'); if ($config->get('language_default', '') == '') { $default = '*'; @@ -409,7 +409,7 @@ public static function prepareContent($text, $params = null, Result $item = null // Instantiate the parameter object if necessary. if (!($params instanceof Registry)) { $registry = new Registry($params); - $params = $registry; + $params = $registry; } // Create a mock content object. diff --git a/administrator/components/com_finder/src/Indexer/Indexer.php b/administrator/components/com_finder/src/Indexer/Indexer.php index f4a15a4acdfdd..843f530b5675e 100644 --- a/administrator/components/com_finder/src/Indexer/Indexer.php +++ b/administrator/components/com_finder/src/Indexer/Indexer.php @@ -139,7 +139,7 @@ public function __construct(DatabaseInterface $db = null) $db->quoteName('phrase'), $db->quoteName('weight'), $db->quoteName('context'), - $db->quoteName('language') + $db->quoteName('language'), ] ); } @@ -160,16 +160,16 @@ public static function getState() // If we couldn't load from the internal state, try the session. $session = Factory::getSession(); - $data = $session->get('_finder.state', null); + $data = $session->get('_finder.state', null); // If the state is empty, load the values for the first time. if (empty($data)) { - $data = new CMSObject(); + $data = new CMSObject(); $data->force = false; // Load the default configuration options. $data->options = ComponentHelper::getParams('com_finder'); - $db = Factory::getDbo(); + $db = Factory::getDbo(); if ($db->getServerType() == 'mysql') { /** @@ -202,7 +202,7 @@ public static function getState() 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) + self::MISC_CONTEXT => round($data->options->get('misc_multiplier', 0.3), 2), ]; // Set the current time as the start time. @@ -282,7 +282,7 @@ public function index($item, $format = 'html') { // Mark beforeIndexing in the profiler. static::$profiler ? static::$profiler->mark('beforeIndexing') : null; - $db = $this->db; + $db = $this->db; $serverType = strtolower($db->getServerType()); // Check if the item is in the database. @@ -304,7 +304,7 @@ public function index($item, $format = 'html') // Get the other item information. $linkId = empty($link->link_id) ? null : $link->link_id; - $isNew = empty($link->link_id); + $isNew = empty($link->link_id); // Check the signatures. If they match, the item is up to date. if (!$isNew && $curSig == $oldSig) { @@ -333,9 +333,9 @@ public function index($item, $format = 'html') // Perform cleanup on the item data. $item->publish_start_date = (int) $item->publish_start_date != 0 ? $item->publish_start_date : null; - $item->publish_end_date = (int) $item->publish_end_date != 0 ? $item->publish_end_date : null; - $item->start_date = (int) $item->start_date != 0 ? $item->start_date : null; - $item->end_date = (int) $item->end_date != 0 ? $item->end_date : null; + $item->publish_end_date = (int) $item->publish_end_date != 0 ? $item->publish_end_date : null; + $item->start_date = (int) $item->start_date != 0 ? $item->start_date : null; + $item->end_date = (int) $item->end_date != 0 ? $item->end_date : null; // Prepare the item description. $item->description = Helper::parse($item->summary ?? ''); @@ -345,25 +345,25 @@ public function index($item, $format = 'html') * already exists in the database, we need to use an UPDATE query. * Otherwise, we need to use an INSERT to get the link id back. */ - $entry = new \stdClass(); - $entry->url = $item->url; + $entry = new \stdClass(); + $entry->url = $item->url; $entry->route = $item->route; $entry->title = $item->title; // We are shortening the description in order to not run into length issues with this field - $entry->description = StringHelper::substr($item->description, 0, 32000); - $entry->indexdate = Factory::getDate()->toSql(); - $entry->state = (int) $item->state; - $entry->access = (int) $item->access; - $entry->language = $item->language; - $entry->type_id = (int) $item->type_id; - $entry->object = ''; + $entry->description = StringHelper::substr($item->description, 0, 32000); + $entry->indexdate = Factory::getDate()->toSql(); + $entry->state = (int) $item->state; + $entry->access = (int) $item->access; + $entry->language = $item->language; + $entry->type_id = (int) $item->type_id; + $entry->object = ''; $entry->publish_start_date = $item->publish_start_date; - $entry->publish_end_date = $item->publish_end_date; - $entry->start_date = $item->start_date; - $entry->end_date = $item->end_date; - $entry->list_price = (double) ($item->list_price ?: 0); - $entry->sale_price = (double) ($item->sale_price ?: 0); + $entry->publish_end_date = $item->publish_end_date; + $entry->start_date = $item->start_date; + $entry->end_date = $item->end_date; + $entry->list_price = (float) ($item->list_price ?: 0); + $entry->sale_price = (float) ($item->sale_price ?: 0); if ($isNew) { // Insert the link and get its id. @@ -706,9 +706,9 @@ public function remove($linkId, $removeTaxonomies = true) public function optimize() { // Get the database object. - $db = $this->db; + $db = $this->db; $serverType = strtolower($db->getServerType()); - $query = $db->getQuery(true); + $query = $db->getQuery(true); // Delete all orphaned terms. $query->delete($db->quoteName('#__finder_terms')) @@ -755,7 +755,7 @@ public function optimize() '#__finder_terms_common', '#__finder_types', '#__finder_taxonomy_map', - '#__finder_taxonomy' + '#__finder_taxonomy', ]; foreach ($tables as $table) { @@ -791,7 +791,7 @@ protected static function getSignature($item) $config = [ $state->weights, $state->options->get('tuplecount', 1), - $state->options->get('language_default', '') + $state->options->get('language_default', ''), ]; return md5(serialize([$item, $config])); @@ -884,8 +884,8 @@ private function tokenizeToDbShort($input, $context, $lang, $format, $count) static $filterCommon, $filterNumeric; if (is_null($filterCommon)) { - $params = ComponentHelper::getParams('com_finder'); - $filterCommon = $params->get('filter_commonwords', false); + $params = ComponentHelper::getParams('com_finder'); + $filterCommon = $params->get('filter_commonwords', false); $filterNumeric = $params->get('filter_numerics', false); } diff --git a/administrator/components/com_finder/src/Indexer/Language/El.php b/administrator/components/com_finder/src/Indexer/Language/El.php index ceb4790b266db..d729e81a541c6 100644 --- a/administrator/components/com_finder/src/Indexer/Language/El.php +++ b/administrator/components/com_finder/src/Indexer/Language/El.php @@ -771,7 +771,7 @@ public function stem($token) */ protected function toUpperCase($token, &$wCase) { - $wCase = array_fill(0, mb_strlen($token, 'UTF-8'), 0); + $wCase = array_fill(0, mb_strlen($token, 'UTF-8'), 0); $caseConvert = [ "α" => 'Α', "β" => 'Β', @@ -823,7 +823,7 @@ protected function toUpperCase($token, &$wCase) } $upperCase = $caseConvert[$char]; - $newToken .= $upperCase; + $newToken .= $upperCase; $wCase[$i] = 1; @@ -893,7 +893,7 @@ protected function toLowerCase($token, $wCase) 'Ο' => 'ό', 'Υ' => 'ύ', 'Ω' => 'ώ', - 'Σ' => 'ς' + 'Σ' => 'ς', ]; $newToken .= $charMap[$char]; @@ -905,7 +905,7 @@ protected function toLowerCase($token, $wCase) if ($wCase[$i] == 3) { $charMap = [ 'Ι' => 'ϊ', - 'Υ' => 'ϋ' + 'Υ' => 'ϋ', ]; $newToken .= $charMap[$char]; @@ -917,7 +917,7 @@ protected function toLowerCase($token, $wCase) if ($wCase[$i] == 4) { $charMap = [ 'Ι' => 'ΐ', - 'Υ' => 'ΰ' + 'Υ' => 'ΰ', ]; $newToken .= $charMap[$char]; diff --git a/administrator/components/com_finder/src/Indexer/Language/Zh.php b/administrator/components/com_finder/src/Indexer/Language/Zh.php index 24b27e5fb3e7e..bfe598b52721a 100644 --- a/administrator/components/com_finder/src/Indexer/Language/Zh.php +++ b/administrator/components/com_finder/src/Indexer/Language/Zh.php @@ -66,7 +66,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 = []; - $charCount = preg_match_all('#[\p{Han}]#mui', $terms[$i], $charMatches); + $charCount = preg_match_all('#[\p{Han}]#mui', $terms[$i], $charMatches); // Split apart any groups of Chinese characters. for ($j = 0; $j < $charCount; $j++) { diff --git a/administrator/components/com_finder/src/Indexer/Parser.php b/administrator/components/com_finder/src/Indexer/Parser.php index 6bf308f3f7c81..8293129a44fec 100644 --- a/administrator/components/com_finder/src/Indexer/Parser.php +++ b/administrator/components/com_finder/src/Indexer/Parser.php @@ -85,9 +85,9 @@ public function parse($input) } // Input is longer than 2Kb so parse it in chunks of 2Kb or less. - $start = 0; - $end = strlen($input); - $chunk = 2048; + $start = 0; + $end = strlen($input); + $chunk = 2048; $return = null; while ($start < $end) { diff --git a/administrator/components/com_finder/src/Indexer/Parser/Html.php b/administrator/components/com_finder/src/Indexer/Parser/Html.php index 001df97e0e342..8534cf00b827a 100644 --- a/administrator/components/com_finder/src/Indexer/Parser/Html.php +++ b/administrator/components/com_finder/src/Indexer/Parser/Html.php @@ -115,10 +115,10 @@ protected function process($input) */ private function removeBlocks($input, $startTag, $endTag) { - $return = ''; - $offset = 0; + $return = ''; + $offset = 0; $startTagLength = strlen($startTag); - $endTagLength = strlen($endTag); + $endTagLength = strlen($endTag); // Find the first start tag. $start = stripos($input, $startTag); diff --git a/administrator/components/com_finder/src/Indexer/Query.php b/administrator/components/com_finder/src/Indexer/Query.php index 2b8bcdfc7c953..f0b5dbfa680ee 100644 --- a/administrator/components/com_finder/src/Indexer/Query.php +++ b/administrator/components/com_finder/src/Indexer/Query.php @@ -523,7 +523,7 @@ protected function processStaticTaxonomy($filterId) // Get a parameter object for the filter date options. $registry = new Registry($return->params); - $params = $registry; + $params = $registry; // Set the dates if not already set. $this->dates->def('d1', $params->get('d1')); @@ -883,7 +883,7 @@ protected function processString($input, $lang, $mode) $input = trim($input); // Get the number of words in the phrase. - $parts = explode(' ', $match); + $parts = explode(' ', $match); $tuplecount = $params->get('tuplecount', 1); // Check if the phrase is longer than our $tuplecount. @@ -894,7 +894,7 @@ protected function processString($input, $lang, $mode) // If the chunk is not empty, add it as a phrase. if (count($chunk)) { $phrases[] = implode(' ', $chunk); - $terms[] = implode(' ', $chunk); + $terms[] = implode(' ', $chunk); } /* @@ -1253,8 +1253,8 @@ protected function getTokenData($token) $searchTerm = $token->term; $searchStem = $token->stem; - $term = $db->quoteName('t.term'); - $stem = $db->quoteName('t.stem'); + $term = $db->quoteName('t.term'); + $stem = $db->quoteName('t.stem'); if ($this->wordmode === 'begin') { $searchTerm .= '%'; diff --git a/administrator/components/com_finder/src/Indexer/Result.php b/administrator/components/com_finder/src/Indexer/Result.php index a570f08bc627b..6cc6470804a74 100644 --- a/administrator/components/com_finder/src/Indexer/Result.php +++ b/administrator/components/com_finder/src/Indexer/Result.php @@ -403,12 +403,12 @@ public function addTaxonomy($branch, $title, $state = 1, $access = 1, $language $branch = preg_replace('#[^\pL\pM\pN\p{Pi}\p{Pf}\'+-.,_]+#mui', ' ', $branch); // Create the taxonomy node. - $node = new \stdClass(); - $node->title = $title; - $node->state = (int) $state; - $node->access = (int) $access; + $node = new \stdClass(); + $node->title = $title; + $node->state = (int) $state; + $node->access = (int) $access; $node->language = $language; - $node->nested = false; + $node->nested = false; // Add the node to the taxonomy branch. $this->taxonomy[$branch][] = $node; @@ -438,13 +438,13 @@ public function addNestedTaxonomy($branch, ImmutableNodeInterface $contentNode, $branch = preg_replace('#[^\pL\pM\pN\p{Pi}\p{Pf}\'+-.,_]+#mui', ' ', $branch); // Create the taxonomy node. - $node = new \stdClass(); - $node->title = $contentNode->title; - $node->state = (int) $state; - $node->access = (int) $access; + $node = new \stdClass(); + $node->title = $contentNode->title; + $node->state = (int) $state; + $node->access = (int) $access; $node->language = $language; - $node->nested = true; - $node->node = $contentNode; + $node->nested = true; + $node->node = $contentNode; // Add the node to the taxonomy branch. $this->taxonomy[$branch][] = $node; @@ -533,7 +533,7 @@ public function __serialize(): array $taxonomy, $this->title, $this->type_id, - $this->url + $this->url, ]; } @@ -573,8 +573,8 @@ public function __unserialize(array $serialized): void foreach ($this->taxonomy as $nodes) { foreach ($nodes as $node) { - $curTaxonomy = Taxonomy::getTaxonomy($node->id); - $node->state = $curTaxonomy->state; + $curTaxonomy = Taxonomy::getTaxonomy($node->id); + $node->state = $curTaxonomy->state; $node->access = $curTaxonomy->access; } } diff --git a/administrator/components/com_finder/src/Indexer/Taxonomy.php b/administrator/components/com_finder/src/Indexer/Taxonomy.php index 950c744c1e7c2..47fa6cad7e3d1 100644 --- a/administrator/components/com_finder/src/Indexer/Taxonomy.php +++ b/administrator/components/com_finder/src/Indexer/Taxonomy.php @@ -63,12 +63,12 @@ class Taxonomy */ public static function addBranch($title, $state = 1, $access = 1) { - $node = new \stdClass(); - $node->title = $title; - $node->state = $state; - $node->access = $access; + $node = new \stdClass(); + $node->title = $title; + $node->state = $state; + $node->access = $access; $node->parent_id = 1; - $node->language = ''; + $node->language = ''; return self::storeNode($node, 1); } @@ -92,12 +92,12 @@ public static function addNode($branch, $title, $state = 1, $access = 1, $langua // Get the branch id, insert it if it does not exist. $branchId = static::addBranch($branch); - $node = new \stdClass(); - $node->title = $title; - $node->state = $state; - $node->access = $access; + $node = new \stdClass(); + $node->title = $title; + $node->state = $state; + $node->access = $access; $node->parent_id = $branchId; - $node->language = $language; + $node->language = $language; return self::storeNode($node, $branchId); } @@ -131,12 +131,12 @@ public static function addNestedNode($branch, NodeInterface $node, $state = 1, $ $parentId = $branchId; } - $temp = new \stdClass(); - $temp->title = $node->title; - $temp->state = $state; - $temp->access = $access; + $temp = new \stdClass(); + $temp->title = $node->title; + $temp->state = $state; + $temp->access = $access; $temp->parent_id = $parentId; - $temp->language = $language; + $temp->language = $language; return self::storeNode($temp, $parentId); } @@ -160,7 +160,7 @@ protected static function storeNode($node, $parentId) } // Check to see if the node is in the table. - $db = Factory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true) ->select('*') ->from($db->quoteName('#__finder_taxonomy')) @@ -191,17 +191,17 @@ protected static function storeNode($node, $parentId) if (empty($result)) { // Prepare the node object. - $nodeTable->title = $node->title; - $nodeTable->state = (int) $node->state; - $nodeTable->access = (int) $node->access; + $nodeTable->title = $node->title; + $nodeTable->state = (int) $node->state; + $nodeTable->access = (int) $node->access; $nodeTable->language = $node->language; $nodeTable->setLocation((int) $parentId, 'last-child'); } else { // Prepare the node object. - $nodeTable->id = (int) $result->id; - $nodeTable->title = $result->title; - $nodeTable->state = (int) ($node->state > 0 ? $node->state : $result->state); - $nodeTable->access = (int) $result->access; + $nodeTable->id = (int) $result->id; + $nodeTable->title = $result->title; + $nodeTable->state = (int) ($node->state > 0 ? $node->state : $result->state); + $nodeTable->access = (int) $result->access; $nodeTable->language = $node->language; $nodeTable->setLocation($result->parent_id, 'last-child'); } @@ -276,7 +276,7 @@ public static function addMap($linkId, $nodeId) $id = (int) $db->loadResult(); if (!$id) { - $map = new \stdClass(); + $map = new \stdClass(); $map->link_id = (int) $linkId; $map->node_id = (int) $nodeId; $db->insertObject('#__finder_taxonomy_map', $map); @@ -364,7 +364,7 @@ public static function getNodeByTitle($branch, $title) public static function removeMaps($linkId) { // Delete the maps. - $db = Factory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true) ->delete($db->quoteName('#__finder_taxonomy_map')) ->where($db->quoteName('link_id') . ' = ' . (int) $linkId); @@ -385,7 +385,7 @@ public static function removeMaps($linkId) public static function removeOrphanMaps() { // Delete all orphaned maps - $db = Factory::getDbo(); + $db = Factory::getDbo(); $query2 = $db->getQuery(true) ->select($db->quoteName('link_id')) ->from($db->quoteName('#__finder_links')); diff --git a/administrator/components/com_finder/src/Indexer/Token.php b/administrator/components/com_finder/src/Indexer/Token.php index 691839737d535..666b8b729ce3b 100644 --- a/administrator/components/com_finder/src/Indexer/Token.php +++ b/administrator/components/com_finder/src/Indexer/Token.php @@ -144,12 +144,12 @@ public function __construct($term, $lang, $spacer = ' ') // Tokens can be a single word or an array of words representing a phrase. if (is_array($term)) { // Populate the token instance. - $this->term = implode($spacer, $term); - $this->stem = implode($spacer, array_map([Helper::class, 'stem'], $term, [$lang])); + $this->term = implode($spacer, $term); + $this->stem = implode($spacer, array_map([Helper::class, 'stem'], $term, [$lang])); $this->numeric = false; - $this->common = false; - $this->phrase = true; - $this->length = StringHelper::strlen($this->term); + $this->common = false; + $this->phrase = true; + $this->length = StringHelper::strlen($this->term); /* * Calculate the weight of the token. @@ -161,12 +161,12 @@ public function __construct($term, $lang, $spacer = ' ') $this->weight = round($this->weight, 4); } else { // Populate the token instance. - $this->term = $term; - $this->stem = Helper::stem($this->term, $lang); + $this->term = $term; + $this->stem = Helper::stem($this->term, $lang); $this->numeric = (is_numeric($this->term) || (bool) preg_match('#^[0-9,.\-\+]+$#', $this->term)); - $this->common = $this->numeric ? false : Helper::isCommon($this->term, $lang); - $this->phrase = false; - $this->length = StringHelper::strlen($this->term); + $this->common = $this->numeric ? false : Helper::isCommon($this->term, $lang); + $this->phrase = false; + $this->length = StringHelper::strlen($this->term); /* * Calculate the weight of the token. diff --git a/administrator/components/com_finder/src/Model/FiltersModel.php b/administrator/components/com_finder/src/Model/FiltersModel.php index 36a28ef6d8791..23e39b7351449 100644 --- a/administrator/components/com_finder/src/Model/FiltersModel.php +++ b/administrator/components/com_finder/src/Model/FiltersModel.php @@ -43,7 +43,7 @@ public function __construct($config = [], MVCFactoryInterface $factory = null) 'state', 'a.state', 'created_by_alias', 'a.created_by_alias', 'created', 'a.created', - 'map_count', 'a.map_count' + 'map_count', 'a.map_count', ]; } @@ -59,7 +59,7 @@ public function __construct($config = [], MVCFactoryInterface $factory = null) */ protected function getListQuery() { - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true); // Select all fields from the table. diff --git a/administrator/components/com_finder/src/Model/IndexModel.php b/administrator/components/com_finder/src/Model/IndexModel.php index f9decf2083580..8a9c9e8679c54 100644 --- a/administrator/components/com_finder/src/Model/IndexModel.php +++ b/administrator/components/com_finder/src/Model/IndexModel.php @@ -118,7 +118,7 @@ protected function canEditState($record) */ public function delete(&$pks) { - $pks = (array) $pks; + $pks = (array) $pks; $table = $this->getTable(); // Include the content plugins for the on delete events. @@ -180,7 +180,7 @@ public function delete(&$pks) */ protected function getListQuery() { - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true) ->select('l.*') ->select($db->quoteName('t.title', 't_title')) @@ -257,7 +257,7 @@ protected function getListQuery() */ public function getPluginState() { - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true) ->select('name, enabled') ->from($db->quoteName('#__extensions')) @@ -302,7 +302,7 @@ protected function getStoreId($id = '') */ public function getTotalIndexed() { - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true) ->select('COUNT(link_id)') ->from($db->quoteName('#__finder_links')); @@ -354,17 +354,17 @@ public function purge() // Truncate the taxonomy table and insert the root node. $db->truncateTable('#__finder_taxonomy'); $root = (object) [ - 'id' => 1, + 'id' => 1, 'parent_id' => 0, - 'lft' => 0, - 'rgt' => 1, - 'level' => 0, - 'path' => '', - 'title' => 'ROOT', - 'alias' => 'root', - 'state' => 1, - 'access' => 1, - 'language' => '*' + 'lft' => 0, + 'rgt' => 1, + 'level' => 0, + 'path' => '', + 'title' => 'ROOT', + 'alias' => 'root', + 'state' => 1, + 'access' => 1, + 'language' => '*', ]; $db->insertObject('#__finder_taxonomy', $root); @@ -420,9 +420,9 @@ protected function populateState($ordering = 'l.title', $direction = 'asc') */ public function publish(&$pks, $value = 1) { - $user = $this->getCurrentUser(); + $user = $this->getCurrentUser(); $table = $this->getTable(); - $pks = (array) $pks; + $pks = (array) $pks; // Include the content plugins for the change of state event. PluginHelper::importPlugin('content'); diff --git a/administrator/components/com_finder/src/Model/MapsModel.php b/administrator/components/com_finder/src/Model/MapsModel.php index 0b9a797953066..a66c3cceec461 100644 --- a/administrator/components/com_finder/src/Model/MapsModel.php +++ b/administrator/components/com_finder/src/Model/MapsModel.php @@ -93,7 +93,7 @@ protected function canEditState($record) */ public function delete(&$pks) { - $pks = (array) $pks; + $pks = (array) $pks; $table = $this->getTable(); // Include the content plugins for the on delete events. @@ -314,9 +314,9 @@ protected function populateState($ordering = 'branch_title, a.lft', $direction = */ public function publish(&$pks, $value = 1) { - $user = $this->getCurrentUser(); + $user = $this->getCurrentUser(); $table = $this->getTable(); - $pks = (array) $pks; + $pks = (array) $pks; // Include the content plugins for the change of state event. PluginHelper::importPlugin('content'); @@ -367,7 +367,7 @@ public function publish(&$pks, $value = 1) */ public function purge() { - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true) ->delete($db->quoteName('#__finder_taxonomy')) ->where($db->quoteName('parent_id') . ' > 1'); diff --git a/administrator/components/com_finder/src/Model/SearchesModel.php b/administrator/components/com_finder/src/Model/SearchesModel.php index 9576eaeb4382f..4d226766e6980 100644 --- a/administrator/components/com_finder/src/Model/SearchesModel.php +++ b/administrator/components/com_finder/src/Model/SearchesModel.php @@ -103,7 +103,7 @@ protected function getStoreId($id = '') protected function getListQuery() { // Create a new query object. - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true); // Select the required fields from the table. diff --git a/administrator/components/com_finder/src/Model/StatisticsModel.php b/administrator/components/com_finder/src/Model/StatisticsModel.php index e5dd06afce18b..8845712b15b58 100644 --- a/administrator/components/com_finder/src/Model/StatisticsModel.php +++ b/administrator/components/com_finder/src/Model/StatisticsModel.php @@ -36,9 +36,9 @@ class StatisticsModel extends BaseDatabaseModel public function getData() { // Initialise - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true); - $data = new CMSObject(); + $data = new CMSObject(); $query->select('COUNT(term_id)') ->from($db->quoteName('#__finder_terms')); @@ -74,7 +74,7 @@ public function getData() $db->setQuery($query); $data->type_list = $db->loadObjectList(); - $lang = Factory::getLanguage(); + $lang = Factory::getLanguage(); $plugins = PluginHelper::getPlugin('finder'); foreach ($plugins as $plugin) { diff --git a/administrator/components/com_finder/src/Response/Response.php b/administrator/components/com_finder/src/Response/Response.php index c59acdce5118b..85442dc0eb345 100644 --- a/administrator/components/com_finder/src/Response/Response.php +++ b/administrator/components/com_finder/src/Response/Response.php @@ -38,7 +38,7 @@ public function __construct($state) $params = ComponentHelper::getParams('com_finder'); if ($params->get('enable_logging', '0')) { - $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; + $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; $options['text_file'] = 'indexer.php'; Log::addLogger($options); } @@ -53,31 +53,31 @@ public function __construct($state) } // Prepare the error response. - $this->error = true; - $this->header = Text::_('COM_FINDER_INDEXER_HEADER_ERROR'); + $this->error = true; + $this->header = Text::_('COM_FINDER_INDEXER_HEADER_ERROR'); $this->message = $state->getMessage(); } else { // Prepare the response data. - $this->batchSize = (int) $state->batchSize; + $this->batchSize = (int) $state->batchSize; $this->batchOffset = (int) $state->batchOffset; - $this->totalItems = (int) $state->totalItems; + $this->totalItems = (int) $state->totalItems; $this->pluginState = $state->pluginState; $this->startTime = $state->startTime; - $this->endTime = Factory::getDate()->toSql(); + $this->endTime = Factory::getDate()->toSql(); - $this->start = !empty($state->start) ? (int) $state->start : 0; + $this->start = !empty($state->start) ? (int) $state->start : 0; $this->complete = !empty($state->complete) ? (int) $state->complete : 0; // Set the appropriate messages. if ($this->totalItems <= 0 && $this->complete) { - $this->header = Text::_('COM_FINDER_INDEXER_HEADER_COMPLETE'); + $this->header = Text::_('COM_FINDER_INDEXER_HEADER_COMPLETE'); $this->message = Text::_('COM_FINDER_INDEXER_MESSAGE_COMPLETE'); } elseif ($this->totalItems <= 0) { - $this->header = Text::_('COM_FINDER_INDEXER_HEADER_OPTIMIZE'); + $this->header = Text::_('COM_FINDER_INDEXER_HEADER_OPTIMIZE'); $this->message = Text::_('COM_FINDER_INDEXER_MESSAGE_OPTIMIZE'); } else { - $this->header = Text::_('COM_FINDER_INDEXER_HEADER_RUNNING'); + $this->header = Text::_('COM_FINDER_INDEXER_HEADER_RUNNING'); $this->message = Text::_('COM_FINDER_INDEXER_MESSAGE_RUNNING'); } } diff --git a/administrator/components/com_finder/src/Service/HTML/Filter.php b/administrator/components/com_finder/src/Service/HTML/Filter.php index b1e0767fe7fbf..97c92d197b636 100644 --- a/administrator/components/com_finder/src/Service/HTML/Filter.php +++ b/administrator/components/com_finder/src/Service/HTML/Filter.php @@ -151,7 +151,7 @@ public function slider($options = []) if (trim($nv->parent_title, '*') === 'Language') { $title = LanguageHelper::branchLanguageTitle($nv->title); } else { - $key = LanguageHelper::branchPlural($nv->title); + $key = LanguageHelper::branchPlural($nv->title); $title = $lang->hasKey($key) ? Text::_($key) : $nv->title; } @@ -323,7 +323,7 @@ public function select($idxQuery, $options) if (trim($node->parent_title, '*') === 'Language') { $title = LanguageHelper::branchLanguageTitle($node->title); } else { - $key = LanguageHelper::branchPlural($node->title); + $key = LanguageHelper::branchPlural($node->title); $title = $language->hasKey($key) ? Text::_($key) : $node->title; } diff --git a/administrator/components/com_finder/src/Service/HTML/Finder.php b/administrator/components/com_finder/src/Service/HTML/Finder.php index 6fdfa98b36e7a..642fcf86f5846 100644 --- a/administrator/components/com_finder/src/Service/HTML/Finder.php +++ b/administrator/components/com_finder/src/Service/HTML/Finder.php @@ -95,7 +95,7 @@ public function mapslist() $lang = Factory::getLanguage(); foreach ($branches as $branch) { - $key = LanguageHelper::branchPlural($branch->text); + $key = LanguageHelper::branchPlural($branch->text); $branch->translatedText = $lang->hasKey($key) ? Text::_($key) : $branch->text; } @@ -103,7 +103,7 @@ public function mapslist() $branches = ArrayHelper::sortObjects($branches, 'translatedText', 1, true, true); // Compile the options. - $options = []; + $options = []; $options[] = HTMLHelper::_('select.option', '', Text::_('COM_FINDER_MAPS_SELECT_BRANCH')); // Convert the values to options. @@ -125,7 +125,7 @@ public static function statelist() { return [ HTMLHelper::_('select.option', '1', Text::sprintf('COM_FINDER_ITEM_X_ONLY', Text::_('JPUBLISHED'))), - HTMLHelper::_('select.option', '0', Text::sprintf('COM_FINDER_ITEM_X_ONLY', Text::_('JUNPUBLISHED'))) + HTMLHelper::_('select.option', '0', Text::sprintf('COM_FINDER_ITEM_X_ONLY', Text::_('JUNPUBLISHED'))), ]; } } diff --git a/administrator/components/com_finder/src/Service/HTML/Query.php b/administrator/components/com_finder/src/Service/HTML/Query.php index 2c5a6579ad8c7..3940a3e70df8a 100644 --- a/administrator/components/com_finder/src/Service/HTML/Query.php +++ b/administrator/components/com_finder/src/Service/HTML/Query.php @@ -62,16 +62,16 @@ public static function explained(IndexerQuery $query) // Process the start date. if ($query->date1) { - $date = Factory::getDate($query->date1)->format(Text::_('DATE_FORMAT_LC')); + $date = Factory::getDate($query->date1)->format(Text::_('DATE_FORMAT_LC')); $datecondition = Text::_('COM_FINDER_QUERY_DATE_CONDITION_' . strtoupper($query->when1)); - $parts[] = '' . Text::sprintf('COM_FINDER_QUERY_START_DATE', $datecondition, $date) . ''; + $parts[] = '' . Text::sprintf('COM_FINDER_QUERY_START_DATE', $datecondition, $date) . ''; } // Process the end date. if ($query->date2) { - $date = Factory::getDate($query->date2)->format(Text::_('DATE_FORMAT_LC')); + $date = Factory::getDate($query->date2)->format(Text::_('DATE_FORMAT_LC')); $datecondition = Text::_('COM_FINDER_QUERY_DATE_CONDITION_' . strtoupper($query->when2)); - $parts[] = '' . Text::sprintf('COM_FINDER_QUERY_END_DATE', $datecondition, $date) . ''; + $parts[] = '' . Text::sprintf('COM_FINDER_QUERY_END_DATE', $datecondition, $date) . ''; } // Process the taxonomy filters. diff --git a/administrator/components/com_finder/src/Table/FilterTable.php b/administrator/components/com_finder/src/Table/FilterTable.php index 8993d0d6c914a..decbd8b51da33 100644 --- a/administrator/components/com_finder/src/Table/FilterTable.php +++ b/administrator/components/com_finder/src/Table/FilterTable.php @@ -119,7 +119,7 @@ public function check() */ public function store($updateNulls = true) { - $date = Factory::getDate()->toSql(); + $date = Factory::getDate()->toSql(); $userId = Factory::getUser()->id; // Set created date if not set. @@ -147,10 +147,10 @@ public function store($updateNulls = true) if (is_array($this->data)) { $this->map_count = count($this->data); - $this->data = implode(',', $this->data); + $this->data = implode(',', $this->data); } else { $this->map_count = 0; - $this->data = implode(',', []); + $this->data = implode(',', []); } // Verify that the alias is unique diff --git a/administrator/components/com_finder/src/View/Filter/HtmlView.php b/administrator/components/com_finder/src/View/Filter/HtmlView.php index 16bf31598d090..a7af7448c3006 100644 --- a/administrator/components/com_finder/src/View/Filter/HtmlView.php +++ b/administrator/components/com_finder/src/View/Filter/HtmlView.php @@ -88,10 +88,10 @@ public function display($tpl = null) { // Load the view data. $this->filter = $this->get('Filter'); - $this->item = $this->get('Item'); - $this->form = $this->get('Form'); - $this->state = $this->get('State'); - $this->total = $this->get('Total'); + $this->item = $this->get('Item'); + $this->form = $this->get('Form'); + $this->state = $this->get('State'); + $this->total = $this->get('Total'); // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -115,10 +115,10 @@ protected function addToolbar() { Factory::getApplication()->getInput()->set('hidemainmenu', true); - $isNew = ($this->item->filter_id == 0); + $isNew = ($this->item->filter_id == 0); $checkedOut = !(is_null($this->item->checked_out) || $this->item->checked_out == $this->getCurrentUser()->id); - $canDo = ContentHelper::getActions('com_finder'); - $toolbar = Toolbar::getInstance(); + $canDo = ContentHelper::getActions('com_finder'); + $toolbar = Toolbar::getInstance(); // Configure the toolbar. ToolbarHelper::title( diff --git a/administrator/components/com_installer/services/provider.php b/administrator/components/com_installer/services/provider.php index 0cc60d9fea3fb..a7742a029b25b 100644 --- a/administrator/components/com_installer/services/provider.php +++ b/administrator/components/com_installer/services/provider.php @@ -25,8 +25,7 @@ * * @since 4.0.0 */ -return new class implements ServiceProviderInterface -{ +return new class () implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * diff --git a/administrator/components/com_installer/src/Controller/UpdateController.php b/administrator/components/com_installer/src/Controller/UpdateController.php index 6ef7b6a32611a..d3800603c6806 100644 --- a/administrator/components/com_installer/src/Controller/UpdateController.php +++ b/administrator/components/com_installer/src/Controller/UpdateController.php @@ -52,7 +52,7 @@ public function update() $uid = array_filter($uid); // Get the minimum stability. - $params = ComponentHelper::getComponent('com_installer')->getParams(); + $params = ComponentHelper::getComponent('com_installer')->getParams(); $minimum_stability = (int) $params->get('minimum_stability', Updater::STABILITY_STABLE); $model->update($uid, $minimum_stability); diff --git a/administrator/components/com_installer/src/Helper/InstallerHelper.php b/administrator/components/com_installer/src/Helper/InstallerHelper.php index c2b8eecb031f8..38170d0a3441e 100644 --- a/administrator/components/com_installer/src/Helper/InstallerHelper.php +++ b/administrator/components/com_installer/src/Helper/InstallerHelper.php @@ -277,7 +277,7 @@ public static function getDownloadKey(CMSObject $extension): array 'valid' => $value ? true : false, 'prefix' => $prefix, 'suffix' => $suffix, - 'value' => $value + 'value' => $value, ]; return $downloadKey; diff --git a/administrator/components/com_installer/src/Model/DatabaseModel.php b/administrator/components/com_installer/src/Model/DatabaseModel.php index b6c48340a1419..3a42033ed276f 100644 --- a/administrator/components/com_installer/src/Model/DatabaseModel.php +++ b/administrator/components/com_installer/src/Model/DatabaseModel.php @@ -80,7 +80,7 @@ public function __construct($config = [], MVCFactoryInterface $factory = null) 'status', 'type', 'type_translated', 'folder', 'folder_translated', - 'extension_id' + 'extension_id', ]; } @@ -178,7 +178,7 @@ private function fetchSchemaCache($cid = 0) if ($installationXML !== null) { $folderTmp = (string) $installationXML->update->schemas->schemapath[0]; - $a = explode('/', $folderTmp); + $a = explode('/', $folderTmp); array_pop($a); $folderTmp = $basePath . '/' . implode('/', $a); } @@ -237,7 +237,7 @@ private function fetchSchemaCache($cid = 0) 'errorsCount' => $errorCount, 'results' => $changeSet->getStatus(), 'schema' => $schema, - 'extension' => $result + 'extension' => $result, ]; } } @@ -283,7 +283,7 @@ public function fix($cids = []) // Load the database issues $this->fetchSchemaCache($cid); - $changeSet = $this->changeSetList[$cid]; + $changeSet = $this->changeSetList[$cid]; $changeSet['changeset'] = new ChangeSet($db, $changeSet['folderTmp']); $changeSet['changeset']->fix(); @@ -348,7 +348,7 @@ protected function getListQuery() 'extensions.manifest_cache', 'extensions.name', 'extensions.type', - 'schemas.version_id' + 'schemas.version_id', ] ) ) @@ -545,7 +545,7 @@ public function compareUpdateVersion($extension) */ private function getOtherInformationMessage($status) { - $problemsMessage = []; + $problemsMessage = []; $problemsMessage[] = Text::sprintf('COM_INSTALLER_MSG_DATABASE_CHECKED_OK', count($status['ok'])); $problemsMessage[] = Text::sprintf('COM_INSTALLER_MSG_DATABASE_SKIPPED', count($status['skipped'])); @@ -591,7 +591,7 @@ public function fixUpdateVersion($extensionId) { $table = new Extension($this->getDatabase()); $table->load($extensionId); - $cache = new Registry($table->manifest_cache); + $cache = new Registry($table->manifest_cache); $updateVersion = $cache->get('version'); if ($table->get('type') === 'file' && $table->get('element') === 'joomla') { diff --git a/administrator/components/com_installer/src/Model/DiscoverModel.php b/administrator/components/com_installer/src/Model/DiscoverModel.php index f5d8c71a2b217..2c8747f586d60 100644 --- a/administrator/components/com_installer/src/Model/DiscoverModel.php +++ b/administrator/components/com_installer/src/Model/DiscoverModel.php @@ -95,7 +95,7 @@ protected function populateState($ordering = 'name', $direction = 'asc') */ protected function getListQuery() { - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true) ->select('*') ->from($db->quoteName('#__extensions')) @@ -155,7 +155,7 @@ public function discover() $results = Installer::getInstance()->discover(); // Get all templates, including discovered ones - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true) ->select($db->quoteName(['extension_id', 'element', 'folder', 'client_id', 'type'])) ->from($db->quoteName('#__extensions')); @@ -171,7 +171,7 @@ public function discover() $install->type, str_replace('\\', '/', $install->element), $install->folder, - $install->client_id + $install->client_id, ] ); $extensions[$key] = $install; @@ -187,7 +187,7 @@ public function discover() $result->type, str_replace('\\', '/', $result->element), $result->folder, - $result->client_id + $result->client_id, ] ); @@ -220,7 +220,7 @@ public function discover_install() $eid = [$eid]; } - $eid = ArrayHelper::toInteger($eid); + $eid = ArrayHelper::toInteger($eid); $failed = false; foreach ($eid as $id) { @@ -258,7 +258,7 @@ public function discover_install() */ public function purge() { - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true) ->delete($db->quoteName('#__extensions')) ->where($db->quoteName('state') . ' = -1'); diff --git a/administrator/components/com_installer/src/Model/InstallModel.php b/administrator/components/com_installer/src/Model/InstallModel.php index b3651a9ead9a1..c0f61cd980580 100644 --- a/administrator/components/com_installer/src/Model/InstallModel.php +++ b/administrator/components/com_installer/src/Model/InstallModel.php @@ -194,13 +194,13 @@ public function install() // Install the package. if (!$installer->install($package['dir'])) { // There was an error installing the package. - $msg = Text::sprintf('COM_INSTALLER_INSTALL_ERROR', Text::_('COM_INSTALLER_TYPE_TYPE_' . strtoupper($package['type']))); - $result = false; + $msg = Text::sprintf('COM_INSTALLER_INSTALL_ERROR', Text::_('COM_INSTALLER_TYPE_TYPE_' . strtoupper($package['type']))); + $result = false; $msgType = 'error'; } else { // Package installed successfully. - $msg = Text::sprintf('COM_INSTALLER_INSTALL_SUCCESS', Text::_('COM_INSTALLER_TYPE_TYPE_' . strtoupper($installLang . $package['type']))); - $result = true; + $msg = Text::sprintf('COM_INSTALLER_INSTALL_SUCCESS', Text::_('COM_INSTALLER_TYPE_TYPE_' . strtoupper($installLang . $package['type']))); + $result = true; $msgType = 'message'; } @@ -337,9 +337,9 @@ protected function _getPackageFromFolder() } $package['packagefile'] = null; - $package['extractdir'] = null; - $package['dir'] = $p_dir; - $package['type'] = $type; + $package['extractdir'] = null; + $package['dir'] = $p_dir; + $package['type'] = $type; return $package; } diff --git a/administrator/components/com_installer/src/Model/InstallerModel.php b/administrator/components/com_installer/src/Model/InstallerModel.php index 857d7ca655e96..37ef17ef4ca07 100644 --- a/administrator/components/com_installer/src/Model/InstallerModel.php +++ b/administrator/components/com_installer/src/Model/InstallerModel.php @@ -118,7 +118,7 @@ protected function _getList($query, $limitstart = 0, $limit = 0) $result = ArrayHelper::sortObjects($result, $listOrder, strtolower($listDirn) == 'desc' ? -1 : 1, false, true); // Process pagination. - $total = count($result); + $total = count($result); $this->cache[$this->getStoreId('getTotal')] = $total; if ($total <= $limitstart) { @@ -171,7 +171,7 @@ protected function translate(&$items) switch ($item->type) { case 'component': $extension = $item->element; - $source = JPATH_ADMINISTRATOR . '/components/' . $extension; + $source = JPATH_ADMINISTRATOR . '/components/' . $extension; $lang->load("$extension.sys", JPATH_ADMINISTRATOR) || $lang->load("$extension.sys", $source); break; case 'file': @@ -179,8 +179,8 @@ protected function translate(&$items) $lang->load("$extension.sys", JPATH_SITE); break; case 'library': - $parts = explode('/', $item->element); - $vendor = (isset($parts[1]) ? $parts[0] : null); + $parts = explode('/', $item->element); + $vendor = (isset($parts[1]) ? $parts[0] : null); $extension = 'lib_' . ($vendor ? implode('_', $parts) : $item->element); if (!$lang->load("$extension.sys", $path)) { @@ -190,17 +190,17 @@ protected function translate(&$items) break; case 'module': $extension = $item->element; - $source = $path . '/modules/' . $extension; + $source = $path . '/modules/' . $extension; $lang->load("$extension.sys", $path) || $lang->load("$extension.sys", $source); break; case 'plugin': $extension = 'plg_' . $item->folder . '_' . $item->element; - $source = JPATH_PLUGINS . '/' . $item->folder . '/' . $item->element; + $source = JPATH_PLUGINS . '/' . $item->folder . '/' . $item->element; $lang->load("$extension.sys", JPATH_ADMINISTRATOR) || $lang->load("$extension.sys", $source); break; case 'template': $extension = 'tpl_' . $item->element; - $source = $path . '/templates/' . $item->element; + $source = $path . '/templates/' . $item->element; $lang->load("$extension.sys", $path) || $lang->load("$extension.sys", $source); break; case 'package': diff --git a/administrator/components/com_installer/src/Model/ManageModel.php b/administrator/components/com_installer/src/Model/ManageModel.php index a01189d86b5fe..4520c9f4ea20a 100644 --- a/administrator/components/com_installer/src/Model/ManageModel.php +++ b/administrator/components/com_installer/src/Model/ManageModel.php @@ -306,7 +306,7 @@ public function remove($eid = []) */ protected function getListQuery() { - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true) ->select('*') ->select('2*protected+(1-protected)*enabled AS status') @@ -363,7 +363,7 @@ protected function getListQuery() // Filter by core extensions. if ($core === '1' || $core === '0') { $coreExtensionIds = ExtensionHelper::getCoreExtensionIds(); - $method = $core === '1' ? 'whereIn' : 'whereNotIn'; + $method = $core === '1' ? 'whereIn' : 'whereNotIn'; $query->$method($db->quoteName('extension_id'), $coreExtensionIds); } @@ -394,7 +394,7 @@ protected function getListQuery() public function loadChangelog($eid, $source) { // Get the changelog URL - $eid = (int) $eid; + $eid = (int) $eid; $db = $this->getDatabase(); $query = $db->getQuery(true) ->select( @@ -405,7 +405,7 @@ public function loadChangelog($eid, $source) 'extensions.folder', 'extensions.changelogurl', 'extensions.manifest_cache', - 'extensions.client_id' + 'extensions.client_id', ] ) ) @@ -440,7 +440,7 @@ public function loadChangelog($eid, $source) 'change' => [], 'remove' => [], 'language' => [], - 'note' => [] + 'note' => [], ]; array_walk( diff --git a/administrator/components/com_installer/src/Model/UpdateModel.php b/administrator/components/com_installer/src/Model/UpdateModel.php index 32afdfa0e6ed2..b671e4534cca4 100644 --- a/administrator/components/com_installer/src/Model/UpdateModel.php +++ b/administrator/components/com_installer/src/Model/UpdateModel.php @@ -212,7 +212,7 @@ protected function translate(&$items) */ protected function _getList($query, $limitstart = 0, $limit = 0) { - $db = $this->getDatabase(); + $db = $this->getDatabase(); $listOrder = $this->getState('list.ordering', 'u.name'); $listDirn = $this->getState('list.direction', 'asc'); @@ -222,7 +222,7 @@ protected function _getList($query, $limitstart = 0, $limit = 0) $result = $db->loadObjectList(); $this->translate($result); $result = ArrayHelper::sortObjects($result, $listOrder, strtolower($listDirn) === 'desc' ? -1 : 1, true, true); - $total = count($result); + $total = count($result); if ($total < $limitstart) { $limitstart = 0; @@ -330,7 +330,7 @@ public function update($uids, $minimumStability = Updater::STABILITY_STABLE) $result = true; foreach ($uids as $uid) { - $update = new Update(); + $update = new Update(); $instance = new \Joomla\CMS\Table\Update($this->getDatabase()); if (!$instance->load($uid)) { @@ -576,7 +576,7 @@ protected function preparePreUpdate($update, $table) // Modules could have a helper which adds additional data case 'module': $cname = str_replace('_', '', $table->element) . 'Helper'; - $path = ($table->client_id ? JPATH_ADMINISTRATOR : JPATH_SITE) . '/modules/' . $table->element . '/helper.php'; + $path = ($table->client_id ? JPATH_ADMINISTRATOR : JPATH_SITE) . '/modules/' . $table->element . '/helper.php'; if (File::exists($path)) { require_once $path; diff --git a/administrator/components/com_installer/src/Model/UpdatesiteModel.php b/administrator/components/com_installer/src/Model/UpdatesiteModel.php index a2b2fc8ad7d18..5dcbd05e5fb3d 100644 --- a/administrator/components/com_installer/src/Model/UpdatesiteModel.php +++ b/administrator/components/com_installer/src/Model/UpdatesiteModel.php @@ -98,7 +98,7 @@ public function getItem($pk = null) 'extensions.element', 'extensions.folder', 'extensions.client_id', - 'extensions.checked_out' + 'extensions.checked_out', ] ) ) @@ -154,7 +154,7 @@ public function save($data): bool } // Delete update records forcing Joomla to fetch them again, applying the new extra_query. - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true) ->delete($db->quoteName('#__updates')) ->where($db->quoteName('update_site_id') . ' = :updateSiteId'); diff --git a/administrator/components/com_installer/src/Model/UpdatesitesModel.php b/administrator/components/com_installer/src/Model/UpdatesitesModel.php index 1e629d1ac85e4..b463d15ac832c 100644 --- a/administrator/components/com_installer/src/Model/UpdatesitesModel.php +++ b/administrator/components/com_installer/src/Model/UpdatesitesModel.php @@ -60,7 +60,7 @@ public function __construct($config = [], MVCFactoryInterface $factory = null) 'folder_translated', 'update_site_id', 'enabled', - 'supported' + 'supported', ]; } @@ -157,7 +157,7 @@ public function delete($ids = []) // Delete the update site from all tables. try { - $id = (int) $id; + $id = (int) $id; $query = $db->getQuery(true) ->delete($db->quoteName('#__update_sites')) ->where($db->quoteName('update_site_id') . ' = :id') @@ -546,7 +546,7 @@ protected function getListQuery() 'e.client_id', 'e.state', 'e.manifest_cache', - 'u.name' + 'u.name', ], [ 'update_site_id', @@ -565,7 +565,7 @@ protected function getListQuery() 'client_id', 'state', 'manifest_cache', - 'editor' + 'editor', ] ) ) diff --git a/administrator/components/com_installer/src/View/Update/HtmlView.php b/administrator/components/com_installer/src/View/Update/HtmlView.php index 74cec3f690e97..a14514b508afd 100644 --- a/administrator/components/com_installer/src/View/Update/HtmlView.php +++ b/administrator/components/com_installer/src/View/Update/HtmlView.php @@ -92,7 +92,7 @@ public function display($tpl = null) } $mappingCallback = function ($item) { - $dlkeyInfo = CmsInstallerHelper::getDownloadKey(new CMSObject($item)); + $dlkeyInfo = CmsInstallerHelper::getDownloadKey(new CMSObject($item)); $item->isMissingDownloadKey = $dlkeyInfo['supported'] && !$dlkeyInfo['valid']; if ($item->isMissingDownloadKey) { diff --git a/administrator/components/com_installer/src/View/Updatesite/HtmlView.php b/administrator/components/com_installer/src/View/Updatesite/HtmlView.php index c82c74cf70aad..5836d3ea0ff4c 100644 --- a/administrator/components/com_installer/src/View/Updatesite/HtmlView.php +++ b/administrator/components/com_installer/src/View/Updatesite/HtmlView.php @@ -70,7 +70,7 @@ public function display($tpl = null): void // Remove the extra_query field if it's a free download extension $dlidSupportingSites = InstallerHelper::getDownloadKeySupportedSites(false); - $update_site_id = $this->item->get('update_site_id'); + $update_site_id = $this->item->get('update_site_id'); if (!in_array($update_site_id, $dlidSupportingSites)) { $this->form->removeField('extra_query'); diff --git a/administrator/components/com_joomlaupdate/extract.php b/administrator/components/com_joomlaupdate/extract.php index 737e15a3bf4e4..25413750742e3 100644 --- a/administrator/components/com_joomlaupdate/extract.php +++ b/administrator/components/com_joomlaupdate/extract.php @@ -678,7 +678,7 @@ public function step(): bool // Update running tallies when we start extracting a file $this->filesProcessed++; - $this->compressedTotal += array_key_exists('compressed', get_object_vars($this->fileHeader)) + $this->compressedTotal += array_key_exists('compressed', get_object_vars($this->fileHeader)) ? $this->fileHeader->compressed : 0; $this->uncompressedTotal += $this->fileHeader->uncompressed; } @@ -1357,8 +1357,8 @@ private function processTypeLink(): bool $toReadBytes = min($leftBytes, self::CHUNK_SIZE); $mydata = $this->fread($this->fp, $toReadBytes); $reallyReadBytes = $this->binStringLength($mydata); - $data .= $mydata; - $leftBytes -= $reallyReadBytes; + $data .= $mydata; + $leftBytes -= $reallyReadBytes; if ($reallyReadBytes < $toReadBytes) { // We read less than requested! @@ -1443,7 +1443,7 @@ private function processTypeFileUncompressed(): bool $toReadBytes = min($leftBytes, self::CHUNK_SIZE); $data = $this->fread($this->fp, $toReadBytes); $reallyReadBytes = $this->binStringLength($data); - $leftBytes -= $reallyReadBytes; + $leftBytes -= $reallyReadBytes; $this->dataReadLength += $reallyReadBytes; if ($reallyReadBytes < $toReadBytes) { diff --git a/administrator/components/com_joomlaupdate/services/provider.php b/administrator/components/com_joomlaupdate/services/provider.php index 73e9c148622ce..db679ba64acab 100644 --- a/administrator/components/com_joomlaupdate/services/provider.php +++ b/administrator/components/com_joomlaupdate/services/provider.php @@ -24,8 +24,7 @@ * * @since 4.0.0 */ -return new class implements ServiceProviderInterface -{ +return new class () implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * diff --git a/administrator/components/com_joomlaupdate/src/Controller/UpdateController.php b/administrator/components/com_joomlaupdate/src/Controller/UpdateController.php index c9abb8bd48229..42bb5fa5c5fba 100644 --- a/administrator/components/com_joomlaupdate/src/Controller/UpdateController.php +++ b/administrator/components/com_joomlaupdate/src/Controller/UpdateController.php @@ -41,7 +41,7 @@ public function download() { $this->checkToken(); - $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; + $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; $options['text_file'] = 'joomla_update.php'; Log::addLogger($options, Log::INFO, ['Update', 'databasequery', 'jerror']); $user = $this->app->getIdentity(); @@ -57,7 +57,7 @@ public function download() $result = $model->download(); $file = $result['basename']; - $message = null; + $message = null; $messageType = null; // The validation was not successful so abort. @@ -89,8 +89,8 @@ public function download() } } else { $this->app->setUserState('com_joomlaupdate.file', null); - $url = 'index.php?option=com_joomlaupdate'; - $message = Text::_('COM_JOOMLAUPDATE_VIEW_UPDATE_DOWNLOADFAILED'); + $url = 'index.php?option=com_joomlaupdate'; + $message = Text::_('COM_JOOMLAUPDATE_VIEW_UPDATE_DOWNLOADFAILED'); $messageType = 'error'; } @@ -109,7 +109,7 @@ public function install() $this->checkToken('get'); $this->app->setUserState('com_joomlaupdate.oldversion', JVERSION); - $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; + $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; $options['text_file'] = 'joomla_update.php'; Log::addLogger($options, Log::INFO, ['Update', 'databasequery', 'jerror']); @@ -147,7 +147,7 @@ public function finalise() return; } - $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; + $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; $options['text_file'] = 'joomla_update.php'; Log::addLogger($options, Log::INFO, ['Update', 'databasequery', 'jerror']); @@ -185,7 +185,7 @@ public function cleanup() return; } - $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; + $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; $options['text_file'] = 'joomla_update.php'; Log::addLogger($options, Log::INFO, ['Update', 'databasequery', 'jerror']); @@ -259,7 +259,7 @@ public function upload() } $token = Session::getFormToken(); - $url = 'index.php?option=com_joomlaupdate&task=update.captive&' . $token . '=1'; + $url = 'index.php?option=com_joomlaupdate&task=update.captive&' . $token . '=1'; $this->setRedirect($url); } @@ -442,13 +442,13 @@ public function finaliseconfirm() */ public function fetchExtensionCompatibility() { - $extensionID = $this->input->get('extension-id', '', 'DEFAULT'); - $joomlaTargetVersion = $this->input->get('joomla-target-version', '', 'DEFAULT'); + $extensionID = $this->input->get('extension-id', '', 'DEFAULT'); + $joomlaTargetVersion = $this->input->get('joomla-target-version', '', 'DEFAULT'); $joomlaCurrentVersion = $this->input->get('joomla-current-version', '', JVERSION); - $extensionVersion = $this->input->get('extension-version', '', 'DEFAULT'); + $extensionVersion = $this->input->get('extension-version', '', 'DEFAULT'); /** @var \Joomla\Component\Joomlaupdate\Administrator\Model\UpdateModel $model */ - $model = $this->getModel('Update'); + $model = $this->getModel('Update'); $upgradeCompatibilityStatus = $model->fetchCompatibility($extensionID, $joomlaTargetVersion); $currentCompatibilityStatus = $model->fetchCompatibility($extensionID, $joomlaCurrentVersion); $upgradeUpdateVersion = false; @@ -502,20 +502,20 @@ public function fetchExtensionCompatibility() // Do we need to capture $combinedCompatibilityStatus = [ 'upgradeCompatibilityStatus' => (object) [ - 'state' => $upgradeCompatibilityStatus->state, - 'compatibleVersion' => $upgradeUpdateVersion + 'state' => $upgradeCompatibilityStatus->state, + 'compatibleVersion' => $upgradeUpdateVersion, ], 'currentCompatibilityStatus' => (object) [ - 'state' => $currentCompatibilityStatus->state, - 'compatibleVersion' => $currentUpdateVersion + 'state' => $currentCompatibilityStatus->state, + 'compatibleVersion' => $currentUpdateVersion, ], - 'resultGroup' => $resultGroup, + 'resultGroup' => $resultGroup, 'upgradeWarning' => $upgradeWarning, ]; - $this->app = Factory::getApplication(); + $this->app = Factory::getApplication(); $this->app->mimeType = 'application/json'; - $this->app->charSet = 'utf-8'; + $this->app->charSet = 'utf-8'; $this->app->setHeader('Content-Type', $this->app->mimeType . '; charset=' . $this->app->charSet); $this->app->sendHeaders(); @@ -539,7 +539,7 @@ public function fetchExtensionCompatibility() */ public function batchextensioncompatibility() { - $joomlaTargetVersion = $this->input->post->get('joomla-target-version', '', 'DEFAULT'); + $joomlaTargetVersion = $this->input->post->get('joomla-target-version', '', 'DEFAULT'); $joomlaCurrentVersion = $this->input->post->get('joomla-current-version', JVERSION); $extensionInformation = $this->input->post->get('extensions', []); @@ -547,8 +547,8 @@ public function batchextensioncompatibility() $model = $this->getModel('Update'); $extensionResults = []; - $leftover = []; - $startTime = microtime(true); + $leftover = []; + $startTime = microtime(true); foreach ($extensionInformation as $information) { // Only process an extension if we have spent less than 5 seconds already @@ -617,19 +617,19 @@ public function batchextensioncompatibility() 'id' => $extensionID, 'upgradeCompatibilityStatus' => (object) [ 'state' => $upgradeCompatibilityStatus->state, - 'compatibleVersion' => $upgradeUpdateVersion + 'compatibleVersion' => $upgradeUpdateVersion, ], 'currentCompatibilityStatus' => (object) [ 'state' => $currentCompatibilityStatus->state, - 'compatibleVersion' => $currentUpdateVersion + 'compatibleVersion' => $currentUpdateVersion, ], - 'resultGroup' => $resultGroup, - 'upgradeWarning' => $upgradeWarning, + 'resultGroup' => $resultGroup, + 'upgradeWarning' => $upgradeWarning, ]; } $this->app->mimeType = 'application/json'; - $this->app->charSet = 'utf-8'; + $this->app->charSet = 'utf-8'; $this->app->setHeader('Content-Type', $this->app->mimeType . '; charset=' . $this->app->charSet); $this->app->sendHeaders(); @@ -664,7 +664,7 @@ public function ajax() } /** @var UpdateModel $model */ - $model = $this->getModel('Update'); + $model = $this->getModel('Update'); $updateInfo = $model->getUpdateInformation(); $update = []; diff --git a/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php b/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php index 8b0da8f687fdc..65e7ee42291c6 100644 --- a/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php +++ b/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php @@ -98,8 +98,8 @@ public function applyUpdateSite() $updateURL = 'https://update.joomla.org/core/list.xml'; } - $id = ExtensionHelper::getExtensionRecord('joomla', 'file')->extension_id; - $db = version_compare(JVERSION, '4.2.0', 'lt') ? $this->getDbo() : $this->getDatabase(); + $id = ExtensionHelper::getExtensionRecord('joomla', 'file')->extension_id; + $db = version_compare(JVERSION, '4.2.0', 'lt') ? $this->getDbo() : $this->getDatabase(); $query = $db->getQuery(true) ->select($db->quoteName('us') . '.*') ->from($db->quoteName('#__update_sites_extensions', 'map')) @@ -116,7 +116,7 @@ public function applyUpdateSite() if ($update_site->location != $updateURL) { // Modify the database record. $update_site->last_check_timestamp = 0; - $update_site->location = $updateURL; + $update_site->location = $updateURL; $db->updateObject('#__update_sites', $update_site, 'update_site_id'); // Remove cached updates. @@ -156,7 +156,7 @@ public function refreshUpdates($force = false) $minimumStability = $comJoomlaupdateParams->get('minimum_stability', Updater::STABILITY_STABLE); } - $reflection = new \ReflectionObject($updater); + $reflection = new \ReflectionObject($updater); $reflectionMethod = $reflection->getMethod('findUpdates'); $methodParameters = $reflectionMethod->getParameters(); @@ -243,12 +243,12 @@ public function getUpdateInformation() 'latest' => null, 'object' => null, 'hasUpdate' => false, - 'current' => JVERSION // This is deprecated please use 'installed' or JVERSION directly + 'current' => JVERSION, // This is deprecated please use 'installed' or JVERSION directly ]; // Fetch the update information from the database. - $id = ExtensionHelper::getExtensionRecord('joomla', 'file')->extension_id; - $db = version_compare(JVERSION, '4.2.0', 'lt') ? $this->getDbo() : $this->getDatabase(); + $id = ExtensionHelper::getExtensionRecord('joomla', 'file')->extension_id; + $db = version_compare(JVERSION, '4.2.0', 'lt') ? $this->getDbo() : $this->getDatabase(); $query = $db->getQuery(true) ->select('*') ->from($db->quoteName('#__updates')) @@ -307,10 +307,10 @@ public function purge() $db = version_compare(JVERSION, '4.2.0', 'lt') ? $this->getDbo() : $this->getDatabase(); // Modify the database record - $update_site = new \stdClass(); + $update_site = new \stdClass(); $update_site->last_check_timestamp = 0; - $update_site->enabled = 1; - $update_site->update_site_id = 1; + $update_site->enabled = 1; + $update_site->update_site_id = 1; $db->updateObject('#__update_sites', $update_site, 'update_site_id'); $query = $db->getQuery(true) @@ -532,7 +532,7 @@ public function createUpdateFile($basename = null): bool // Get a password $password = UserHelper::genRandomPassword(32); - $app = Factory::getApplication(); + $app = Factory::getApplication(); // Trigger event before joomla update. $app->triggerEvent('onJoomlaBeforeUpdate'); @@ -544,7 +544,7 @@ public function createUpdateFile($basename = null): bool if (empty($basename)) { $updateInfo = $this->getUpdateInformation(); $packageURL = $updateInfo['object']->downloadurl->_data; - $basename = basename($packageURL); + $basename = basename($packageURL); } // Get the package name. @@ -636,7 +636,7 @@ public function finaliseUpgrade() $installer->setUpgrade(true); $installer->setOverwrite(true); - $db = version_compare(JVERSION, '4.2.0', 'lt') ? $this->getDbo() : $this->getDatabase(); + $db = version_compare(JVERSION, '4.2.0', 'lt') ? $this->getDbo() : $this->getDatabase(); $installer->extension = new \Joomla\CMS\Table\Extension($db); $installer->extension->load(ExtensionHelper::getExtensionRecord('joomla', 'file')->extension_id); @@ -698,7 +698,7 @@ public function finaliseUpgrade() return false; } - $id = $db->loadResult(); + $id = $db->loadResult(); $row = new \Joomla\CMS\Table\Extension($db); if ($id) { @@ -785,7 +785,7 @@ public function finaliseUpgrade() // Clobber any possible pending updates. $update = new \Joomla\CMS\Table\Update($db); - $uid = $update->find( + $uid = $update->find( ['element' => 'joomla', 'type' => 'file', 'client_id' => '0', 'folder' => ''] ); @@ -1053,40 +1053,40 @@ public function getPhpOptions() // Check for mbstring options. if (extension_loaded('mbstring')) { // Check for default MB language. - $option = new \stdClass(); + $option = new \stdClass(); $option->label = Text::_('INSTL_MB_LANGUAGE_IS_DEFAULT'); $option->state = strtolower(ini_get('mbstring.language')) === 'neutral'; $option->notice = $option->state ? null : Text::_('INSTL_NOTICEMBLANGNOTDEFAULT'); - $options[] = $option; + $options[] = $option; // Check for MB function overload. - $option = new \stdClass(); + $option = new \stdClass(); $option->label = Text::_('INSTL_MB_STRING_OVERLOAD_OFF'); $option->state = ini_get('mbstring.func_overload') == 0; $option->notice = $option->state ? null : Text::_('INSTL_NOTICEMBSTRINGOVERLOAD'); - $options[] = $option; + $options[] = $option; } // Check for a missing native parse_ini_file implementation. - $option = new \stdClass(); + $option = new \stdClass(); $option->label = Text::_('INSTL_PARSE_INI_FILE_AVAILABLE'); $option->state = $this->getIniParserAvailability(); $option->notice = null; - $options[] = $option; + $options[] = $option; // Check for missing native json_encode / json_decode support. - $option = new \stdClass(); - $option->label = Text::_('INSTL_JSON_SUPPORT_AVAILABLE'); - $option->state = function_exists('json_encode') && function_exists('json_decode'); - $option->notice = null; - $options[] = $option; + $option = new \stdClass(); + $option->label = Text::_('INSTL_JSON_SUPPORT_AVAILABLE'); + $option->state = function_exists('json_encode') && function_exists('json_decode'); + $option->notice = null; + $options[] = $option; $updateInformation = $this->getUpdateInformation(); // Check if configured database is compatible with the next major version of Joomla $nextMajorVersion = Version::MAJOR_VERSION + 1; if (version_compare($updateInformation['latest'], (string) $nextMajorVersion, '>=')) { - $option = new \stdClass(); + $option = new \stdClass(); $option->label = Text::sprintf('INSTL_DATABASE_SUPPORTED', $this->getConfiguredDatabaseType()); $option->state = $this->isDatabaseTypeSupported(); $option->notice = null; @@ -1094,11 +1094,11 @@ public function getPhpOptions() } // Check if database structure is up to date - $option = new \stdClass(); + $option = new \stdClass(); $option->label = Text::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_DATABASE_STRUCTURE_TITLE'); $option->state = $this->getDatabaseSchemaCheck(); $option->notice = $option->state ? null : Text::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_DATABASE_STRUCTURE_NOTICE'); - $options[] = $option; + $options[] = $option; return $options; } @@ -1116,60 +1116,60 @@ public function getPhpSettings() $settings = []; // Check for display errors. - $setting = new \stdClass(); - $setting->label = Text::_('INSTL_DISPLAY_ERRORS'); - $setting->state = (bool) ini_get('display_errors'); + $setting = new \stdClass(); + $setting->label = Text::_('INSTL_DISPLAY_ERRORS'); + $setting->state = (bool) ini_get('display_errors'); $setting->recommended = false; - $settings[] = $setting; + $settings[] = $setting; // Check for file uploads. - $setting = new \stdClass(); - $setting->label = Text::_('INSTL_FILE_UPLOADS'); - $setting->state = (bool) ini_get('file_uploads'); + $setting = new \stdClass(); + $setting->label = Text::_('INSTL_FILE_UPLOADS'); + $setting->state = (bool) ini_get('file_uploads'); $setting->recommended = true; - $settings[] = $setting; + $settings[] = $setting; // Check for output buffering. - $setting = new \stdClass(); - $setting->label = Text::_('INSTL_OUTPUT_BUFFERING'); - $setting->state = (int) ini_get('output_buffering') !== 0; + $setting = new \stdClass(); + $setting->label = Text::_('INSTL_OUTPUT_BUFFERING'); + $setting->state = (int) ini_get('output_buffering') !== 0; $setting->recommended = false; - $settings[] = $setting; + $settings[] = $setting; // Check for session auto-start. - $setting = new \stdClass(); - $setting->label = Text::_('INSTL_SESSION_AUTO_START'); - $setting->state = (bool) ini_get('session.auto_start'); + $setting = new \stdClass(); + $setting->label = Text::_('INSTL_SESSION_AUTO_START'); + $setting->state = (bool) ini_get('session.auto_start'); $setting->recommended = false; - $settings[] = $setting; + $settings[] = $setting; // Check for native ZIP support. - $setting = new \stdClass(); - $setting->label = Text::_('INSTL_ZIP_SUPPORT_AVAILABLE'); - $setting->state = function_exists('zip_open') && function_exists('zip_read'); + $setting = new \stdClass(); + $setting->label = Text::_('INSTL_ZIP_SUPPORT_AVAILABLE'); + $setting->state = function_exists('zip_open') && function_exists('zip_read'); $setting->recommended = true; - $settings[] = $setting; + $settings[] = $setting; // Check for GD support - $setting = new \stdClass(); - $setting->label = Text::sprintf('INSTL_EXTENSION_AVAILABLE', 'GD'); - $setting->state = extension_loaded('gd'); + $setting = new \stdClass(); + $setting->label = Text::sprintf('INSTL_EXTENSION_AVAILABLE', 'GD'); + $setting->state = extension_loaded('gd'); $setting->recommended = true; - $settings[] = $setting; + $settings[] = $setting; // Check for iconv support - $setting = new \stdClass(); - $setting->label = Text::sprintf('INSTL_EXTENSION_AVAILABLE', 'iconv'); - $setting->state = function_exists('iconv'); + $setting = new \stdClass(); + $setting->label = Text::sprintf('INSTL_EXTENSION_AVAILABLE', 'iconv'); + $setting->state = function_exists('iconv'); $setting->recommended = true; - $settings[] = $setting; + $settings[] = $setting; // Check for intl support - $setting = new \stdClass(); - $setting->label = Text::sprintf('INSTL_EXTENSION_AVAILABLE', 'intl'); - $setting->state = function_exists('transliterator_transliterate'); + $setting = new \stdClass(); + $setting->label = Text::sprintf('INSTL_EXTENSION_AVAILABLE', 'intl'); + $setting->state = function_exists('transliterator_transliterate'); $setting->recommended = true; - $settings[] = $setting; + $settings[] = $setting; return $settings; } @@ -1202,7 +1202,7 @@ public function isDatabaseTypeSupported() // Check if configured database is compatible with Joomla 4 if (version_compare($updateInformation['latest'], (string) $nextMajorVersion, '>=')) { $unsupportedDatabaseTypes = ['sqlsrv', 'sqlazure']; - $currentDatabaseType = $this->getConfiguredDatabaseType(); + $currentDatabaseType = $this->getConfiguredDatabaseType(); return !in_array($currentDatabaseType, $unsupportedDatabaseTypes); } @@ -1254,7 +1254,7 @@ public function getIniParserAvailability() if (!empty($disabledFunctions)) { // Attempt to detect them in the PHP INI disable_functions variable. - $disabledFunctions = explode(',', trim($disabledFunctions)); + $disabledFunctions = explode(',', trim($disabledFunctions)); $numberOfDisabledFunctions = count($disabledFunctions); for ($i = 0; $i < $numberOfDisabledFunctions; $i++) { @@ -1291,7 +1291,7 @@ private function getDatabaseSchemaCheck(): bool } $coreExtensionInfo = \Joomla\CMS\Extension\ExtensionHelper::getExtensionRecord('joomla', 'file'); - $cache = new \Joomla\Registry\Registry($coreExtensionInfo->manifest_cache); + $cache = new \Joomla\Registry\Registry($coreExtensionInfo->manifest_cache); $updateVersion = $cache->get('version'); @@ -1330,7 +1330,7 @@ private function getDatabaseSchemaCheck(): bool */ public function getNonCoreExtensions() { - $db = version_compare(JVERSION, '4.2.0', 'lt') ? $this->getDbo() : $this->getDatabase(); + $db = version_compare(JVERSION, '4.2.0', 'lt') ? $this->getDbo() : $this->getDatabase(); $query = $db->getQuery(true); $query->select( @@ -1380,7 +1380,7 @@ public function getNonCoreExtensions() */ public function getNonCorePlugins($folderFilter = ['system','user','authentication','actionlog','multifactorauth']) { - $db = version_compare(JVERSION, '4.2.0', 'lt') ? $this->getDbo() : $this->getDatabase(); + $db = version_compare(JVERSION, '4.2.0', 'lt') ? $this->getDbo() : $this->getDatabase(); $query = $db->getQuery(true); $query->select( @@ -1480,8 +1480,8 @@ public function fetchCompatibility($extensionID, $joomlaTargetVersion) */ private function getUpdateSitesInfo($extensionID) { - $id = (int) $extensionID; - $db = version_compare(JVERSION, '4.2.0', 'lt') ? $this->getDbo() : $this->getDatabase(); + $id = (int) $extensionID; + $db = version_compare(JVERSION, '4.2.0', 'lt') ? $this->getDbo() : $this->getDatabase(); $query = $db->getQuery(true); $query->select( @@ -1490,7 +1490,7 @@ private function getUpdateSitesInfo($extensionID) $db->quoteName('us.location'), $db->quoteName('e.element', 'ext_element'), $db->quoteName('e.type', 'ext_type'), - $db->quoteName('e.folder', 'ext_folder') + $db->quoteName('e.folder', 'ext_folder'), ] ) ->from($db->quoteName('#__update_sites', 'us')) @@ -1593,7 +1593,7 @@ private function checkCompatibility($updateFileUrl, $joomlaTargetVersion) // Check if old version of the updater library if (!isset($compatibleVersions)) { - $downloadUrl = $update->get('downloadurl'); + $downloadUrl = $update->get('downloadurl'); $updateVersion = $update->get('version'); return empty($downloadUrl) || empty($downloadUrl->_data) || empty($updateVersion) ? [] : [$updateVersion->_data]; @@ -1620,16 +1620,16 @@ protected function translateExtensionName(&$item) $path = $item->client_id ? JPATH_ADMINISTRATOR : JPATH_SITE; $extension = $item->element; - $source = JPATH_SITE; + $source = JPATH_SITE; switch ($item->type) { case 'component': $extension = $item->element; - $source = $path . '/components/' . $extension; + $source = $path . '/components/' . $extension; break; case 'module': $extension = $item->element; - $source = $path . '/modules/' . $extension; + $source = $path . '/modules/' . $extension; break; case 'file': $extension = 'files_' . $item->element; @@ -1639,11 +1639,11 @@ protected function translateExtensionName(&$item) break; case 'plugin': $extension = 'plg_' . $item->folder . '_' . $item->element; - $source = JPATH_PLUGINS . '/' . $item->folder . '/' . $item->element; + $source = JPATH_PLUGINS . '/' . $item->folder . '/' . $item->element; break; case 'template': $extension = 'tpl_' . $item->element; - $source = $path . '/templates/' . $item->element; + $source = $path . '/templates/' . $item->element; } $lang->load("$extension.sys", JPATH_ADMINISTRATOR) @@ -1666,14 +1666,14 @@ protected function translateExtensionName(&$item) */ public function isTemplateActive($template) { - $db = version_compare(JVERSION, '4.2.0', 'lt') ? $this->getDbo() : $this->getDatabase(); + $db = version_compare(JVERSION, '4.2.0', 'lt') ? $this->getDbo() : $this->getDatabase(); $query = $db->getQuery(true); $query->select( $db->quoteName( [ 'id', - 'home' + 'home', ] ) )->from( diff --git a/administrator/components/com_joomlaupdate/src/View/Joomlaupdate/HtmlView.php b/administrator/components/com_joomlaupdate/src/View/Joomlaupdate/HtmlView.php index f4e7f970b6781..a2c0157dd892f 100644 --- a/administrator/components/com_joomlaupdate/src/View/Joomlaupdate/HtmlView.php +++ b/administrator/components/com_joomlaupdate/src/View/Joomlaupdate/HtmlView.php @@ -173,7 +173,7 @@ public function display($tpl = null) $this->state = $this->get('State'); - $hasUpdate = !empty($this->updateInfo['hasUpdate']); + $hasUpdate = !empty($this->updateInfo['hasUpdate']); $hasDownload = isset($this->updateInfo['object']->downloadurl->_data); // Fresh update, show it diff --git a/administrator/components/com_joomlaupdate/src/View/Upload/HtmlView.php b/administrator/components/com_joomlaupdate/src/View/Upload/HtmlView.php index d9c54bc6602b8..e7d989ae2f8e2 100644 --- a/administrator/components/com_joomlaupdate/src/View/Upload/HtmlView.php +++ b/administrator/components/com_joomlaupdate/src/View/Upload/HtmlView.php @@ -78,14 +78,14 @@ public function display($tpl = null) $language->load('com_installer', JPATH_ADMINISTRATOR, 'en-GB', false, true); $language->load('com_installer', JPATH_ADMINISTRATOR, null, true); - $this->updateInfo = $this->get('UpdateInformation'); + $this->updateInfo = $this->get('UpdateInformation'); $this->selfUpdateAvailable = $this->get('CheckForSelfUpdate'); if ($this->getLayout() !== 'captive') { $this->warnings = $this->get('Items', 'warnings'); } - $params = ComponentHelper::getParams('com_joomlaupdate'); + $params = ComponentHelper::getParams('com_joomlaupdate'); $this->noBackupCheck = $params->get('backupcheck', 1) == 0; $this->addToolbar(); diff --git a/administrator/components/com_languages/services/provider.php b/administrator/components/com_languages/services/provider.php index b47d560cb2285..6d504ef83249c 100644 --- a/administrator/components/com_languages/services/provider.php +++ b/administrator/components/com_languages/services/provider.php @@ -25,8 +25,7 @@ * * @since 4.0.0 */ -return new class implements ServiceProviderInterface -{ +return new class () implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * diff --git a/administrator/components/com_languages/src/Controller/InstalledController.php b/administrator/components/com_languages/src/Controller/InstalledController.php index 7127a4aaede05..421f787394356 100644 --- a/administrator/components/com_languages/src/Controller/InstalledController.php +++ b/administrator/components/com_languages/src/Controller/InstalledController.php @@ -44,22 +44,22 @@ public function setDefault() if ($model->publish($cid)) { // Switching to the new administrator language for the message if ($model->getState('client_id') == 1) { - $language = Factory::getLanguage(); - $newLang = Language::getInstance($cid); + $language = Factory::getLanguage(); + $newLang = Language::getInstance($cid); Factory::$language = $newLang; $this->app->loadLanguage($language = $newLang); $newLang->load('com_languages', JPATH_ADMINISTRATOR); } if (Multilanguage::isEnabled() && $model->getState('client_id') == 0) { - $msg = Text::_('COM_LANGUAGES_MSG_DEFAULT_MULTILANG_SAVED'); + $msg = Text::_('COM_LANGUAGES_MSG_DEFAULT_MULTILANG_SAVED'); $type = 'message'; } else { - $msg = Text::_('COM_LANGUAGES_MSG_DEFAULT_LANGUAGE_SAVED'); + $msg = Text::_('COM_LANGUAGES_MSG_DEFAULT_LANGUAGE_SAVED'); $type = 'message'; } } else { - $msg = $model->getError(); + $msg = $model->getError(); $type = 'error'; } @@ -91,17 +91,17 @@ public function switchAdminLanguage() if ($model->switchAdminLanguage($cid)) { // Switching to the new language for the message - $languageName = $info['nativeName']; - $language = Factory::getLanguage(); - $newLang = Language::getInstance($cid); + $languageName = $info['nativeName']; + $language = Factory::getLanguage(); + $newLang = Language::getInstance($cid); Factory::$language = $newLang; $this->app->loadLanguage($language = $newLang); $newLang->load('com_languages', JPATH_ADMINISTRATOR); - $msg = Text::sprintf('COM_LANGUAGES_MSG_SWITCH_ADMIN_LANGUAGE_SUCCESS', $languageName); + $msg = Text::sprintf('COM_LANGUAGES_MSG_SWITCH_ADMIN_LANGUAGE_SUCCESS', $languageName); $type = 'message'; } else { - $msg = $model->getError(); + $msg = $model->getError(); $type = 'error'; } diff --git a/administrator/components/com_languages/src/Controller/LanguagesController.php b/administrator/components/com_languages/src/Controller/LanguagesController.php index 2531687e1239a..a65cf3fd4f15f 100644 --- a/administrator/components/com_languages/src/Controller/LanguagesController.php +++ b/administrator/components/com_languages/src/Controller/LanguagesController.php @@ -60,7 +60,7 @@ public function getQuickiconContent() $result['amount'] = $amount; $result['sronly'] = Text::plural('COM_LANGUAGES_N_QUICKICON_SRONLY', $amount); - $result['name'] = Text::plural('COM_LANGUAGES_N_QUICKICON', $amount); + $result['name'] = Text::plural('COM_LANGUAGES_N_QUICKICON', $amount); echo new JsonResponse($result); } diff --git a/administrator/components/com_languages/src/Controller/OverrideController.php b/administrator/components/com_languages/src/Controller/OverrideController.php index 8b05d62fe4780..55bdbf7e40865 100644 --- a/administrator/components/com_languages/src/Controller/OverrideController.php +++ b/administrator/components/com_languages/src/Controller/OverrideController.php @@ -79,7 +79,7 @@ public function save($key = null, $urlVar = null) $context = "$this->option.edit.$this->context"; $task = $this->getTask(); - $recordId = $this->input->get('id'); + $recordId = $this->input->get('id'); $data['id'] = $recordId; // Access check. diff --git a/administrator/components/com_languages/src/Helper/MultilangstatusHelper.php b/administrator/components/com_languages/src/Helper/MultilangstatusHelper.php index da2dcc5397183..60c5a50e822a6 100644 --- a/administrator/components/com_languages/src/Helper/MultilangstatusHelper.php +++ b/administrator/components/com_languages/src/Helper/MultilangstatusHelper.php @@ -35,7 +35,7 @@ abstract class MultilangstatusHelper public static function getHomes() { // Check for multiple Home pages. - $db = Factory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true) ->select('COUNT(*)') ->from($db->quoteName('#__menu')) @@ -60,7 +60,7 @@ public static function getHomes() public static function getLangswitchers() { // Check if switcher is published. - $db = Factory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true) ->select('COUNT(*)') ->from($db->quoteName('#__modules')) @@ -85,7 +85,7 @@ public static function getLangswitchers() public static function getContentlangs() { // Check for published Content Languages. - $db = Factory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true) ->select( [ @@ -109,7 +109,7 @@ public static function getContentlangs() public static function getStatus() { // Check for combined status. - $db = Factory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true); // Select all fields from the languages table. @@ -152,7 +152,7 @@ public static function getStatus() */ public static function getContacts() { - $db = Factory::getDbo(); + $db = Factory::getDbo(); $languages = count(LanguageHelper::getLanguages()); // Get the number of contact with all as language @@ -250,7 +250,7 @@ public static function getContacts() public static function getDefaultHomeModule() { // Find Default Home menutype. - $db = Factory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('menutype')) ->from($db->quoteName('#__menu')) diff --git a/administrator/components/com_languages/src/Model/InstalledModel.php b/administrator/components/com_languages/src/Model/InstalledModel.php index 55a3f3a8022fa..49335bfa18655 100644 --- a/administrator/components/com_languages/src/Model/InstalledModel.php +++ b/administrator/components/com_languages/src/Model/InstalledModel.php @@ -239,8 +239,8 @@ public function getData() } // Process ordering. - $listOrder = $this->getState('list.ordering', 'name'); - $listDirn = $this->getState('list.direction', 'ASC'); + $listOrder = $this->getState('list.ordering', 'name'); + $listDirn = $this->getState('list.direction', 'ASC'); $installedLanguages = ArrayHelper::sortObjects($installedLanguages, $listOrder, strtolower($listDirn) === 'desc' ? -1 : 1, true, true); // Process pagination. @@ -339,7 +339,7 @@ public function publish($cid) protected function getFolders() { if (is_null($this->folders)) { - $path = $this->getPath(); + $path = $this->getPath(); $this->folders = Folder::folders($path, '.', false, false, ['.svn', 'CVS', '.DS_Store', '__MACOSX', 'pdf_fonts', 'overrides']); } diff --git a/administrator/components/com_languages/src/Model/LanguageModel.php b/administrator/components/com_languages/src/Model/LanguageModel.php index c6cc0b204d214..e028b2f41824a 100644 --- a/administrator/components/com_languages/src/Model/LanguageModel.php +++ b/administrator/components/com_languages/src/Model/LanguageModel.php @@ -48,8 +48,8 @@ public function __construct($config = [], MVCFactoryInterface $factory = null) 'event_after_save' => 'onExtensionAfterSave', 'event_before_save' => 'onExtensionBeforeSave', 'events_map' => [ - 'save' => 'extension' - ] + 'save' => 'extension', + ], ], $config ); diff --git a/administrator/components/com_languages/src/Model/LanguagesModel.php b/administrator/components/com_languages/src/Model/LanguagesModel.php index dda9399b0e4b5..e4925fbdbfe36 100644 --- a/administrator/components/com_languages/src/Model/LanguagesModel.php +++ b/administrator/components/com_languages/src/Model/LanguagesModel.php @@ -111,7 +111,7 @@ protected function getStoreId($id = '') protected function getListQuery() { // Create a new query object. - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true); // Select all fields from the languages table. diff --git a/administrator/components/com_languages/src/Model/OverrideModel.php b/administrator/components/com_languages/src/Model/OverrideModel.php index 4b6068c7771ab..112c630823de0 100644 --- a/administrator/components/com_languages/src/Model/OverrideModel.php +++ b/administrator/components/com_languages/src/Model/OverrideModel.php @@ -102,7 +102,7 @@ public function getItem($pk = null) . '/language/overrides/' . $this->getState('filter.language', 'en-GB') . '.override.ini'; $strings = LanguageHelper::parseIniFile($fileName); - $result = new \stdClass(); + $result = new \stdClass(); $result->key = ''; $result->override = ''; @@ -114,7 +114,7 @@ public function getItem($pk = null) $oppositeFileName = constant('JPATH_' . strtoupper($this->getState('filter.client') == 'site' ? 'administrator' : 'site')) . '/language/overrides/' . $this->getState('filter.language', 'en-GB') . '.override.ini'; $oppositeStrings = LanguageHelper::parseIniFile($oppositeFileName); - $result->both = isset($oppositeStrings[$pk]) && ($oppositeStrings[$pk] == $strings[$pk]); + $result->both = isset($oppositeStrings[$pk]) && ($oppositeStrings[$pk] == $strings[$pk]); return $result; } diff --git a/administrator/components/com_languages/src/Model/OverridesModel.php b/administrator/components/com_languages/src/Model/OverridesModel.php index 24bf0d81602b5..77fad3681819c 100644 --- a/administrator/components/com_languages/src/Model/OverridesModel.php +++ b/administrator/components/com_languages/src/Model/OverridesModel.php @@ -83,10 +83,10 @@ public function getOverrides($all = false) $search = $this->getState('filter.search'); if ($search != '') { - $search = preg_quote($search, '~'); + $search = preg_quote($search, '~'); $matchvals = preg_grep('~' . $search . '~i', $strings); $matchkeys = array_intersect_key($strings, array_flip(preg_grep('~' . $search . '~i', array_keys($strings)))); - $strings = array_merge($matchvals, $matchkeys); + $strings = array_merge($matchvals, $matchkeys); } // Consider the ordering @@ -202,11 +202,11 @@ public function delete($cids) $app = Factory::getApplication(); if ($app->isClient('api')) { - $cids = (array) $cids; + $cids = (array) $cids; $client = $this->getState('filter.client'); } else { $filterclient = Factory::getApplication()->getUserState('com_languages.overrides.filter.client'); - $client = $filterclient == 0 ? 'site' : 'administrator'; + $client = $filterclient == 0 ? 'site' : 'administrator'; } // Parse the override.ini file in order to get the keys and strings. diff --git a/administrator/components/com_languages/src/Model/StringsModel.php b/administrator/components/com_languages/src/Model/StringsModel.php index fe9aa1b1a8aea..9c1dd336328c4 100644 --- a/administrator/components/com_languages/src/Model/StringsModel.php +++ b/administrator/components/com_languages/src/Model/StringsModel.php @@ -130,10 +130,10 @@ public function refresh() */ public function search() { - $results = []; - $input = Factory::getApplication()->getInput(); - $filter = InputFilter::getInstance(); - $db = $this->getDatabase(); + $results = []; + $input = Factory::getApplication()->getInput(); + $filter = InputFilter::getInstance(); + $db = $this->getDatabase(); $searchTerm = $input->getString('searchstring'); $limitstart = $input->getInt('more'); diff --git a/administrator/components/com_languages/src/Service/HTML/Languages.php b/administrator/components/com_languages/src/Service/HTML/Languages.php index 8ae92dc2c34e5..8a868892c0096 100644 --- a/administrator/components/com_languages/src/Service/HTML/Languages.php +++ b/administrator/components/com_languages/src/Service/HTML/Languages.php @@ -69,7 +69,7 @@ public function clients() { return [ HTMLHelper::_('select.option', 0, Text::_('JSITE')), - HTMLHelper::_('select.option', 1, Text::_('JADMINISTRATOR')) + HTMLHelper::_('select.option', 1, Text::_('JADMINISTRATOR')), ]; } diff --git a/administrator/components/com_languages/src/View/Overrides/HtmlView.php b/administrator/components/com_languages/src/View/Overrides/HtmlView.php index e27d5a1d3b873..5b0d1f595834e 100644 --- a/administrator/components/com_languages/src/View/Overrides/HtmlView.php +++ b/administrator/components/com_languages/src/View/Overrides/HtmlView.php @@ -97,7 +97,7 @@ public function display($tpl = null) protected function addToolbar() { // Get the results for each action - $canDo = ContentHelper::getActions('com_languages'); + $canDo = ContentHelper::getActions('com_languages'); $toolbar = Toolbar::getInstance(); ToolbarHelper::title(Text::_('COM_LANGUAGES_VIEW_OVERRIDES_TITLE'), 'comments langmanager'); diff --git a/administrator/components/com_login/services/provider.php b/administrator/components/com_login/services/provider.php index eb064b3428dff..5de4d643dff9c 100644 --- a/administrator/components/com_login/services/provider.php +++ b/administrator/components/com_login/services/provider.php @@ -24,8 +24,7 @@ * * @since 4.0.0 */ -return new class implements ServiceProviderInterface -{ +return new class () implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * diff --git a/administrator/components/com_login/src/Controller/DisplayController.php b/administrator/components/com_login/src/Controller/DisplayController.php index da29db7a9022b..a3a3c14b179ff 100644 --- a/administrator/components/com_login/src/Controller/DisplayController.php +++ b/administrator/components/com_login/src/Controller/DisplayController.php @@ -75,9 +75,9 @@ public function login() $app = $this->app; - $model = $this->getModel('login'); + $model = $this->getModel('login'); $credentials = $model->getState('credentials'); - $return = $model->getState('return'); + $return = $model->getState('return'); $app->login($credentials, ['action' => 'core.login.admin']); diff --git a/administrator/components/com_login/src/Model/LoginModel.php b/administrator/components/com_login/src/Model/LoginModel.php index 5d44ad81b0e2b..0800ba211e040 100644 --- a/administrator/components/com_login/src/Model/LoginModel.php +++ b/administrator/components/com_login/src/Model/LoginModel.php @@ -78,9 +78,9 @@ protected function populateState() */ public static function getLoginModule($name = 'mod_login', $title = null) { - $result = null; + $result = null; $modules = self::_load($name); - $total = count($modules); + $total = count($modules); for ($i = 0; $i < $total; $i++) { // Match the title if we're looking for a specific instance of the module. @@ -92,16 +92,16 @@ public static function getLoginModule($name = 'mod_login', $title = null) // If we didn't find it, and the name is mod_something, create a dummy object. if (is_null($result) && substr($name, 0, 4) == 'mod_') { - $result = new \stdClass(); - $result->id = 0; - $result->title = ''; - $result->module = $name; - $result->position = ''; - $result->content = ''; + $result = new \stdClass(); + $result->id = 0; + $result->title = ''; + $result->module = $name; + $result->position = ''; + $result->content = ''; $result->showtitle = 0; - $result->control = ''; - $result->params = ''; - $result->user = 0; + $result->control = ''; + $result->params = ''; + $result->user = 0; } return $result; @@ -149,7 +149,7 @@ protected static function _load($module) 'm.module', 'm.position', 'm.showtitle', - 'm.params' + 'm.params', ] ) ) diff --git a/administrator/components/com_mails/services/provider.php b/administrator/components/com_mails/services/provider.php index 794bdfe532688..11cc7bc38117f 100644 --- a/administrator/components/com_mails/services/provider.php +++ b/administrator/components/com_mails/services/provider.php @@ -24,8 +24,7 @@ * * @since 4.0.0 */ -return new class implements ServiceProviderInterface -{ +return new class () implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * diff --git a/administrator/components/com_mails/src/Controller/TemplateController.php b/administrator/components/com_mails/src/Controller/TemplateController.php index 918e1ff9e4c7b..d170c7bef300c 100644 --- a/administrator/components/com_mails/src/Controller/TemplateController.php +++ b/administrator/components/com_mails/src/Controller/TemplateController.php @@ -85,7 +85,7 @@ public function edit($key = null, $urlVar = null) // Get the previous record id (if any) and the current record id. $template_id = $this->input->getCmd('template_id'); - $language = $this->input->getCmd('language'); + $language = $this->input->getCmd('language'); // Access check. if (!$this->allowEdit(['template_id' => $template_id, 'language' => $language], $template_id)) { @@ -131,7 +131,7 @@ public function edit($key = null, $urlVar = null) protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') { $language = array_pop($recordId); - $return = parent::getRedirectToItemAppend(array_pop($recordId), $urlVar); + $return = parent::getRedirectToItemAppend(array_pop($recordId), $urlVar); $return .= '&language=' . $language; return $return; @@ -153,17 +153,17 @@ public function save($key = null, $urlVar = null) $this->checkToken(); /** @var \Joomla\CMS\MVC\Model\AdminModel $model */ - $model = $this->getModel(); - $data = $this->input->post->get('jform', [], 'array'); + $model = $this->getModel(); + $data = $this->input->post->get('jform', [], 'array'); $context = "$this->option.edit.$this->context"; - $task = $this->getTask(); + $task = $this->getTask(); $recordId = $this->input->getCmd('template_id'); $language = $this->input->getCmd('language'); // Populate the row id from the session. $data['template_id'] = $recordId; - $data['language'] = $language; + $data['language'] = $language; // Access check. if (!$this->allowSave($data, 'template_id')) { diff --git a/administrator/components/com_mails/src/Model/TemplateModel.php b/administrator/components/com_mails/src/Model/TemplateModel.php index 4877a3ec4aa85..d1fd122c92317 100644 --- a/administrator/components/com_mails/src/Model/TemplateModel.php +++ b/administrator/components/com_mails/src/Model/TemplateModel.php @@ -130,9 +130,9 @@ public function getForm($data = [], $loadData = true) return $form; } - $field = $form->getField('attachments'); + $field = $form->getField('attachments'); $subform = new \SimpleXMLElement($field->formsource); - $files = $subform->xpath('field[@name="file"]'); + $files = $subform->xpath('field[@name="file"]'); $files[0]->addAttribute('directory', $attachmentPath); $form->load('getState($this->getName() . '.template_id'); - $language = $this->getState($this->getName() . '.language'); - $table = $this->getTable('Template', 'Table'); + $language = $this->getState($this->getName() . '.language'); + $table = $this->getTable('Template', 'Table'); if ($templateId != '' && $language != '') { // Attempt to load the row. @@ -172,10 +172,10 @@ public function getItem($pk = null) // Convert to the CMSObject before adding other data. $properties = $table->getProperties(1); - $item = ArrayHelper::toObject($properties, CMSObject::class); + $item = ArrayHelper::toObject($properties, CMSObject::class); if (property_exists($item, 'params')) { - $registry = new Registry($item->params); + $registry = new Registry($item->params); $item->params = $registry->toArray(); } @@ -202,7 +202,7 @@ public function getItem($pk = null) public function getMaster($pk = null) { $template_id = $this->getState($this->getName() . '.template_id'); - $table = $this->getTable('Template', 'Table'); + $table = $this->getTable('Template', 'Table'); if ($template_id != '') { // Attempt to load the row. @@ -218,10 +218,10 @@ public function getMaster($pk = null) // Convert to the CMSObject before adding other data. $properties = $table->getProperties(1); - $item = ArrayHelper::toObject($properties, CMSObject::class); + $item = ArrayHelper::toObject($properties, CMSObject::class); if (property_exists($item, 'params')) { - $registry = new Registry($item->params); + $registry = new Registry($item->params); $item->params = $registry->toArray(); } @@ -255,7 +255,7 @@ public function getTable($name = 'Template', $prefix = 'Administrator', $options protected function loadFormData() { // Check the session for previously entered form data. - $app = Factory::getApplication(); + $app = Factory::getApplication(); $data = $app->getUserState('com_mails.edit.template.data', []); if (empty($data)) { @@ -305,10 +305,10 @@ public function save($data) $table = $this->getTable(); $context = $this->option . '.' . $this->name; - $key = $table->getKeyName(); + $key = $table->getKeyName(); $template_id = (!empty($data['template_id'])) ? $data['template_id'] : $this->getState($this->getName() . '.template_id'); - $language = (!empty($data['language'])) ? $data['language'] : $this->getState($this->getName() . '.language'); - $isNew = true; + $language = (!empty($data['language'])) ? $data['language'] : $this->getState($this->getName() . '.language'); + $isNew = true; // Include the plugins for the save events. \Joomla\CMS\Plugin\PluginHelper::importPlugin($this->events_map['save']); diff --git a/administrator/components/com_mails/src/Model/TemplatesModel.php b/administrator/components/com_mails/src/Model/TemplatesModel.php index 5a6eb90fb5642..eda12f4de957f 100644 --- a/administrator/components/com_mails/src/Model/TemplatesModel.php +++ b/administrator/components/com_mails/src/Model/TemplatesModel.php @@ -43,7 +43,7 @@ public function __construct($config = []) 'subject', 'a.subject', 'body', 'a.body', 'htmlbody', 'a.htmlbody', - 'extension' + 'extension', ]; } @@ -88,7 +88,7 @@ public function getItems() $items = parent::getItems(); $id = ''; - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true) ->select($db->quoteName('language')) ->from($db->quoteName('#__mail_templates')) @@ -116,7 +116,7 @@ public function getItems() protected function getListQuery() { // Create a new query object. - $db = $this->getDatabase(); + $db = $this->getDatabase(); $query = $db->getQuery(true); // Select the required fields from the table. diff --git a/administrator/components/com_mails/src/View/Template/HtmlView.php b/administrator/components/com_mails/src/View/Template/HtmlView.php index 9c425c49d043d..6a1b4d0fdf4e0 100644 --- a/administrator/components/com_mails/src/View/Template/HtmlView.php +++ b/administrator/components/com_mails/src/View/Template/HtmlView.php @@ -75,10 +75,10 @@ class HtmlView extends BaseHtmlView */ public function display($tpl = null) { - $this->state = $this->get('State'); - $this->item = $this->get('Item'); + $this->state = $this->get('State'); + $this->item = $this->get('Item'); $this->master = $this->get('Master'); - $this->form = $this->get('Form'); + $this->form = $this->get('Form'); // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -86,9 +86,9 @@ public function display($tpl = null) } list($component, $template_id) = explode('.', $this->item->template_id, 2); - $fields = ['subject', 'body', 'htmlbody']; - $this->templateData = []; - $language = Factory::getLanguage(); + $fields = ['subject', 'body', 'htmlbody']; + $this->templateData = []; + $language = Factory::getLanguage(); $language->load($component, JPATH_SITE, $this->item->language, true); $language->load($component, JPATH_SITE . '/components/' . $component, $this->item->language, true); $language->load($component, JPATH_ADMINISTRATOR, $this->item->language, true); diff --git a/administrator/components/com_mails/src/View/Templates/HtmlView.php b/administrator/components/com_mails/src/View/Templates/HtmlView.php index 2d067921accac..375e30109d684 100644 --- a/administrator/components/com_mails/src/View/Templates/HtmlView.php +++ b/administrator/components/com_mails/src/View/Templates/HtmlView.php @@ -136,7 +136,7 @@ protected function addToolbar() { // Get the toolbar object instance $toolbar = Toolbar::getInstance('toolbar'); - $user = $this->getCurrentUser(); + $user = $this->getCurrentUser(); ToolbarHelper::title(Text::_('COM_MAILS_MAILS_TITLE'), 'envelope'); diff --git a/administrator/components/com_media/services/provider.php b/administrator/components/com_media/services/provider.php index dbab9ac0dd137..9bfa93841ca6f 100644 --- a/administrator/components/com_media/services/provider.php +++ b/administrator/components/com_media/services/provider.php @@ -24,8 +24,7 @@ * * @since 4.0.0 */ -return new class implements ServiceProviderInterface -{ +return new class () implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * diff --git a/administrator/components/com_media/src/Event/FetchMediaItemUrlEvent.php b/administrator/components/com_media/src/Event/FetchMediaItemUrlEvent.php index f444cf6f0fe15..4d463639579ef 100644 --- a/administrator/components/com_media/src/Event/FetchMediaItemUrlEvent.php +++ b/administrator/components/com_media/src/Event/FetchMediaItemUrlEvent.php @@ -53,7 +53,7 @@ public function __construct($name, array $arguments = []) // Check for required arguments if (!\array_key_exists('url', $arguments) || !is_string($arguments['url'])) { - throw new \BadMethodCallException("Argument 'url' of event $name is not of the expected type"); + throw new \BadMethodCallException("Argument 'url' of event $name is not of the expected type"); } parent::__construct($name, $arguments); diff --git a/administrator/components/com_media/src/Plugin/MediaActionPlugin.php b/administrator/components/com_media/src/Plugin/MediaActionPlugin.php index 6a8b19d86bc70..cc862adb3439d 100644 --- a/administrator/components/com_media/src/Plugin/MediaActionPlugin.php +++ b/administrator/components/com_media/src/Plugin/MediaActionPlugin.php @@ -77,7 +77,7 @@ protected function loadJs() 'script', 'plg_media-action_' . $this->_name . '/' . $this->_name . '.js', ['version' => 'auto', 'relative' => true], - ['type' => 'module'] + ['type' => 'module'] ); } diff --git a/administrator/components/com_media/src/Provider/ProviderManagerHelperTrait.php b/administrator/components/com_media/src/Provider/ProviderManagerHelperTrait.php index d535c252f162b..a41d81e3b6430 100644 --- a/administrator/components/com_media/src/Provider/ProviderManagerHelperTrait.php +++ b/administrator/components/com_media/src/Provider/ProviderManagerHelperTrait.php @@ -107,7 +107,7 @@ public function getAdapter(string $name): AdapterInterface protected function resolveAdapterAndPath(string $path): array { $result = []; - $parts = explode(':', $path, 2); + $parts = explode(':', $path, 2); // If we have 2 parts, we have both an adapter name and a file path if (\count($parts) === 2) { diff --git a/administrator/components/com_menus/layouts/joomla/searchtools/default.php b/administrator/components/com_menus/layouts/joomla/searchtools/default.php index 6ffa5d2d5b478..b9df8a0febc9d 100644 --- a/administrator/components/com_menus/layouts/joomla/searchtools/default.php +++ b/administrator/components/com_menus/layouts/joomla/searchtools/default.php @@ -86,7 +86,7 @@ ?>