From bff17dfdbf6e875d189e9a4de921642364756101 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Fri, 12 Jul 2019 00:39:23 +0200 Subject: [PATCH] [4.0] Codestyle fixes for new CMS codestyle Batch 16/16 (#25471) --- .../com_config/Field/FiltersField.php | 6 ++- .../com_config/Model/ApplicationModel.php | 10 +++- .../com_contenthistory/Model/CompareModel.php | 6 ++- .../components/com_login/Model/LoginModel.php | 5 +- .../com_contact/View/Contact/HtmlView.php | 53 ++++++++++++++++--- .../com_content/Helper/AssociationHelper.php | 11 +++- components/com_content/Model/ArticleModel.php | 6 ++- .../com_content/View/Article/HtmlView.php | 3 +- .../com_content/View/Category/FeedView.php | 3 +- .../com_content/View/Featured/FeedView.php | 3 +- .../com_finder/View/Search/HtmlView.php | 4 +- .../com_tags/Controller/DisplayController.php | 3 +- components/com_tags/View/Tag/HtmlView.php | 12 +++-- .../com_users/Model/RegistrationModel.php | 18 +++++-- .../Form/Field/Installation/SampleField.php | 7 +-- installation/src/Model/DatabaseModel.php | 9 +++- .../Document/Renderer/Html/MetasRenderer.php | 6 ++- .../Installer/Adapter/ComponentAdapter.php | 3 +- .../src/Installer/Adapter/LanguageAdapter.php | 16 +++--- .../src/Installer/Adapter/LibraryAdapter.php | 4 +- libraries/src/Installer/Installer.php | 4 +- libraries/src/MVC/Model/BaseDatabaseModel.php | 1 + libraries/src/Menu/SiteMenu.php | 5 +- .../src/Schema/ChangeItem/MysqlChangeItem.php | 2 +- .../ChangeItem/PostgresqlChangeItem.php | 2 +- .../Schema/ChangeItem/SqlsrvChangeItem.php | 2 +- libraries/src/Session/Session.php | 12 +++-- .../src/Toolbar/Button/DropdownButton.php | 2 +- modules/mod_menu/Helper/MenuHelper.php | 3 +- plugins/system/remember/remember.php | 3 +- .../updatenotification/updatenotification.php | 36 ++++++------- plugins/user/terms/terms.php | 2 +- templates/cassiopeia/index.php | 4 +- 33 files changed, 187 insertions(+), 79 deletions(-) diff --git a/administrator/components/com_config/Field/FiltersField.php b/administrator/components/com_config/Field/FiltersField.php index dbd9ba9674b..021faf918f4 100644 --- a/administrator/components/com_config/Field/FiltersField.php +++ b/administrator/components/com_config/Field/FiltersField.php @@ -132,7 +132,8 @@ class FiltersField extends FormField $html[] = ' ' . LayoutHelper::render('joomla.html.treeprefix', array('level' => $group->level + 1)) . $group->text; $html[] = ' '; $html[] = ' '; - $html[] = ' '; + $html[] = ' '; $html[] = ' id . $group->value . '_filter_tags" class="sr-only">' . Text::_('JGLOBAL_FILTER_TAGS_LABEL') . ''; + $html[] = ' '; $html[] = ' enqueueMessage( - Text::sprintf('COM_CONFIG_ERROR_CUSTOM_SESSION_FILESYSTEM_PATH_NOTWRITABLE_USING_DEFAULT', $data['session_filesystem_path']), + Text::sprintf( + 'COM_CONFIG_ERROR_CUSTOM_SESSION_FILESYSTEM_PATH_NOTWRITABLE_USING_DEFAULT', + $data['session_filesystem_path'] + ), 'warning' ); } diff --git a/administrator/components/com_contenthistory/Model/CompareModel.php b/administrator/components/com_contenthistory/Model/CompareModel.php index 9283ad49f11..d23a2826886 100644 --- a/administrator/components/com_contenthistory/Model/CompareModel.php +++ b/administrator/components/com_contenthistory/Model/CompareModel.php @@ -103,7 +103,11 @@ class CompareModel extends ListModel { if (array_key_exists($dateProperty, $object->data) && $object->data->$dateProperty->value != $nullDate) { - $object->data->$dateProperty->value = HTMLHelper::_('date', $object->data->$dateProperty->value, Text::_('DATE_FORMAT_LC6')); + $object->data->$dateProperty->value = HTMLHelper::_( + 'date', + $object->data->$dateProperty->value, + Text::_('DATE_FORMAT_LC6') + ); } } diff --git a/administrator/components/com_login/Model/LoginModel.php b/administrator/components/com_login/Model/LoginModel.php index 01924a6d913..5c071538669 100644 --- a/administrator/components/com_login/Model/LoginModel.php +++ b/administrator/components/com_login/Model/LoginModel.php @@ -177,7 +177,10 @@ class LoginModel extends BaseDatabaseModel } catch (ExecutionFailureException $databaseException) { - Factory::getApplication()->enqueueMessage(Text::sprintf('JLIB_APPLICATION_ERROR_MODULE_LOAD', $databaseException->getMessage()), 'error'); + Factory::getApplication()->enqueueMessage( + Text::sprintf('JLIB_APPLICATION_ERROR_MODULE_LOAD', $databaseException->getMessage()), + 'error' + ); return array(); } diff --git a/components/com_contact/View/Contact/HtmlView.php b/components/com_contact/View/Contact/HtmlView.php index e67e587e931..8d0e1b0df71 100644 --- a/components/com_contact/View/Contact/HtmlView.php +++ b/components/com_contact/View/Contact/HtmlView.php @@ -241,7 +241,13 @@ class HtmlView extends BaseHtmlView default : if ($item->params->get('icon_address')) { - $image1 = HTMLHelper::_('image', $item->params->get('icon_address', 'con_address.png'), Text::_('COM_CONTACT_ADDRESS'), null, false); + $image1 = HTMLHelper::_( + 'image', + $item->params->get('icon_address', 'con_address.png'), + Text::_('COM_CONTACT_ADDRESS'), + null, + false + ); } else { @@ -255,16 +261,34 @@ class HtmlView extends BaseHtmlView if ($item->params->get('icon_email')) { - $image2 = HTMLHelper::_('image', $item->params->get('icon_email', 'emailButton.png'), Text::_('JGLOBAL_EMAIL'), null, false); + $image2 = HTMLHelper::_( + 'image', + $item->params->get('icon_email', 'emailButton.png'), + Text::_('JGLOBAL_EMAIL'), + null, + false + ); } else { - $image2 = HTMLHelper::_('image', 'contacts/' . $item->params->get('icon_email', 'emailButton.png'), Text::_('JGLOBAL_EMAIL'), null, true); + $image2 = HTMLHelper::_( + 'image', + 'contacts/' . $item->params->get('icon_email', 'emailButton.png'), + Text::_('JGLOBAL_EMAIL'), + null, + true + ); } if ($item->params->get('icon_telephone')) { - $image3 = HTMLHelper::_('image', $item->params->get('icon_telephone', 'con_tel.png'), Text::_('COM_CONTACT_TELEPHONE'), null, false); + $image3 = HTMLHelper::_( + 'image', + $item->params->get('icon_telephone', 'con_tel.png'), + Text::_('COM_CONTACT_TELEPHONE'), + null, + false + ); } else { @@ -283,12 +307,24 @@ class HtmlView extends BaseHtmlView } else { - $image4 = HTMLHelper::_('image', 'contacts/' . $item->params->get('icon_fax', 'con_fax.png'), Text::_('COM_CONTACT_FAX'), null, true); + $image4 = HTMLHelper::_( + 'image', + 'contacts/' . $item->params->get('icon_fax', 'con_fax.png'), + Text::_('COM_CONTACT_FAX'), + null, + true + ); } if ($item->params->get('icon_misc')) { - $image5 = HTMLHelper::_('image', $item->params->get('icon_misc', 'con_info.png'), Text::_('COM_CONTACT_OTHER_INFORMATION'), null, false); + $image5 = HTMLHelper::_( + 'image', + $item->params->get('icon_misc', 'con_info.png'), + Text::_('COM_CONTACT_OTHER_INFORMATION'), + null, + false + ); } else { @@ -468,7 +504,10 @@ class HtmlView extends BaseHtmlView $path = array(array('title' => $this->item->name, 'link' => '')); $category = Categories::getInstance('Contact')->get($this->item->catid); - while ($category && ($menu->query['option'] !== 'com_contact' || $menu->query['view'] === 'contact' || $id != $category->id) && $category->id > 1) + while ($category && ($menu->query['option'] !== 'com_contact' + || $menu->query['view'] === 'contact' + || $id != $category->id) && $category->id > 1 + ) { $path[] = array('title' => $category->title, 'link' => ContactHelperRoute::getCategoryRoute($category->id, $category->language)); $category = $category->getParent(); diff --git a/components/com_content/Helper/AssociationHelper.php b/components/com_content/Helper/AssociationHelper.php index ba5b2fbaf82..6a3f6d3d7b9 100644 --- a/components/com_content/Helper/AssociationHelper.php +++ b/components/com_content/Helper/AssociationHelper.php @@ -77,7 +77,16 @@ abstract class AssociationHelper extends CategoryAssociationHelper $advClause[] = 'c2.state = 1'; } - $associations = Associations::getAssociations('com_content', '#__content', 'com_content.item', $id, 'id', 'alias', 'catid', $advClause); + $associations = Associations::getAssociations( + 'com_content', + '#__content', + 'com_content.item', + $id, + 'id', + 'alias', + 'catid', + $advClause + ); $return = array(); diff --git a/components/com_content/Model/ArticleModel.php b/components/com_content/Model/ArticleModel.php index b13b284db91..cf0d4225200 100644 --- a/components/com_content/Model/ArticleModel.php +++ b/components/com_content/Model/ArticleModel.php @@ -144,7 +144,9 @@ class ArticleModel extends ItemModel $query->select('ROUND(v.rating_sum / v.rating_count, 0) AS rating, v.rating_count as rating_count') ->join('LEFT', '#__content_rating AS v ON a.id = v.content_id'); - if ((!$user->authorise('core.edit.state', 'com_content.article.' . $pk)) && (!$user->authorise('core.edit', 'com_content.article.' . $pk))) + if (!$user->authorise('core.edit.state', 'com_content.article.' . $pk) + && !$user->authorise('core.edit', 'com_content.article.' . $pk) + ) { // Filter by start and end dates. $nullDate = $db->quote($db->getNullDate()); @@ -322,7 +324,7 @@ class ArticleModel extends ItemModel // Create the base insert statement. $query->insert($db->quoteName('#__content_rating')) - ->columns(array($db->quoteName('content_id'), $db->quoteName('lastip'), $db->quoteName('rating_sum'), $db->quoteName('rating_count'))) + ->columns([$db->quoteName('content_id'), $db->quoteName('lastip'), $db->quoteName('rating_sum'), $db->quoteName('rating_count')]) ->values((int) $pk . ', ' . $db->quote($userIP) . ',' . (int) $rate . ', 1'); // Set the query and execute the insert. diff --git a/components/com_content/View/Article/HtmlView.php b/components/com_content/View/Article/HtmlView.php index f846a012092..3cfcb7094d7 100644 --- a/components/com_content/View/Article/HtmlView.php +++ b/components/com_content/View/Article/HtmlView.php @@ -300,7 +300,8 @@ class HtmlView extends BaseHtmlView $path = array(array('title' => $this->item->title, 'link' => '')); $category = Categories::getInstance('Content')->get($this->item->catid); - while ($category && ($menu->query['option'] !== 'com_content' || $menu->query['view'] === 'article' || $id != $category->id) && $category->id > 1) + while ($category + && ($menu->query['option'] !== 'com_content' || $menu->query['view'] === 'article' || $id != $category->id) && $category->id > 1) { $path[] = array('title' => $category->title, 'link' => RouteHelper::getCategoryRoute($category->id, $category->language)); $category = $category->getParent(); diff --git a/components/com_content/View/Category/FeedView.php b/components/com_content/View/Category/FeedView.php index 3023c141a88..32351b0f4d5 100644 --- a/components/com_content/View/Category/FeedView.php +++ b/components/com_content/View/Category/FeedView.php @@ -65,7 +65,8 @@ class FeedView extends CategoryFeedView // URL link to article $link = Route::_(\ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language)); - $item->description .= '

' . Text::_('COM_CONTENT_FEED_READMORE') . '

'; + $item->description .= '

' + . Text::_('COM_CONTENT_FEED_READMORE') . '

'; } $item->author = $item->created_by_alias ?: $item->author; diff --git a/components/com_content/View/Featured/FeedView.php b/components/com_content/View/Featured/FeedView.php index e9a6191b066..a846477f2a6 100644 --- a/components/com_content/View/Featured/FeedView.php +++ b/components/com_content/View/Featured/FeedView.php @@ -114,7 +114,8 @@ class FeedView extends AbstractView // Add readmore link to description if introtext is shown, show_readmore is true and fulltext exists if (!$params->get('feed_summary', 0) && $params->get('feed_show_readmore', 0) && $row->fulltext) { - $description .= '

' . Text::_('COM_CONTENT_FEED_READMORE') . '

'; + $description .= '

' + . Text::_('COM_CONTENT_FEED_READMORE') . '

'; } // Load item description and add div diff --git a/components/com_finder/View/Search/HtmlView.php b/components/com_finder/View/Search/HtmlView.php index ef9476c2e2a..2024fa4e83e 100644 --- a/components/com_finder/View/Search/HtmlView.php +++ b/components/com_finder/View/Search/HtmlView.php @@ -340,7 +340,9 @@ class HtmlView extends BaseHtmlView // Check for OpenSearch if ($this->params->get('opensearch', 1)) { - $ostitle = $this->params->get('opensearch_name', Text::_('COM_FINDER_OPENSEARCH_NAME') . ' ' . Factory::getApplication()->get('sitename')); + $ostitle = $this->params->get('opensearch_name', + Text::_('COM_FINDER_OPENSEARCH_NAME') . ' ' . Factory::getApplication()->get('sitename') + ); Factory::getDocument()->addHeadLink( Uri::getInstance()->toString(array('scheme', 'host', 'port')) . Route::_('index.php?option=com_finder&view=search&format=opensearch'), 'search', 'rel', array('title' => $ostitle, 'type' => 'application/opensearchdescription+xml') diff --git a/components/com_tags/Controller/DisplayController.php b/components/com_tags/Controller/DisplayController.php index 4fc4a115e6f..1d9e599b729 100644 --- a/components/com_tags/Controller/DisplayController.php +++ b/components/com_tags/Controller/DisplayController.php @@ -25,7 +25,8 @@ class DisplayController extends BaseController * Method to display a view. * * @param boolean $cachable If true, the view output will be cached - * @param mixed|boolean $urlparams An array of safe URL parameters and their variable types, for valid values see {@link \JFilterInput::clean()}. + * @param mixed|boolean $urlparams An array of safe URL parameters and their + * variable types, for valid values see {@link \JFilterInput::clean()}. * * @return static This object to support chaining. * diff --git a/components/com_tags/View/Tag/HtmlView.php b/components/com_tags/View/Tag/HtmlView.php index 9b5cb10738e..156f06bd1c8 100644 --- a/components/com_tags/View/Tag/HtmlView.php +++ b/components/com_tags/View/Tag/HtmlView.php @@ -174,13 +174,19 @@ class HtmlView extends BaseHtmlView Factory::getApplication()->triggerEvent('onContentPrepare', ['com_tags.tag', &$itemElement, &$itemElement->core_params, 0]); - $results = Factory::getApplication()->triggerEvent('onContentAfterTitle', ['com_tags.tag', &$itemElement, &$itemElement->core_params, 0]); + $results = Factory::getApplication()->triggerEvent('onContentAfterTitle', + ['com_tags.tag', &$itemElement, &$itemElement->core_params, 0] + ); $itemElement->event->afterDisplayTitle = trim(implode("\n", $results)); - $results = Factory::getApplication()->triggerEvent('onContentBeforeDisplay', ['com_tags.tag', &$itemElement, &$itemElement->core_params, 0]); + $results = Factory::getApplication()->triggerEvent('onContentBeforeDisplay', + ['com_tags.tag', &$itemElement, &$itemElement->core_params, 0] + ); $itemElement->event->beforeDisplayContent = trim(implode("\n", $results)); - $results = Factory::getApplication()->triggerEvent('onContentAfterDisplay', ['com_tags.tag', &$itemElement, &$itemElement->core_params, 0]); + $results = Factory::getApplication()->triggerEvent('onContentAfterDisplay', + ['com_tags.tag', &$itemElement, &$itemElement->core_params, 0] + ); $itemElement->event->afterDisplayContent = trim(implode("\n", $results)); // Write the results back into the body diff --git a/components/com_users/Model/RegistrationModel.php b/components/com_users/Model/RegistrationModel.php index 8b04e09b18f..85f7c60b2ee 100644 --- a/components/com_users/Model/RegistrationModel.php +++ b/components/com_users/Model/RegistrationModel.php @@ -136,7 +136,11 @@ class RegistrationModel extends FormModel $data['activation'] = ApplicationHelper::getHash(UserHelper::genRandomPassword()); $user->set('activation', $data['activation']); $data['siteurl'] = Uri::base(); - $data['activate'] = Route::link('site', 'index.php?option=com_users&task=registration.activate&token=' . $data['activation'], false, $linkMode); + $data['activate'] = Route::link('site', + 'index.php?option=com_users&task=registration.activate&token=' . $data['activation'], + false, + $linkMode + ); $data['fromname'] = $app->get('fromname'); $data['mailfrom'] = $app->get('mailfrom'); @@ -525,7 +529,11 @@ class RegistrationModel extends FormModel // Set the link to confirm the user email. $linkMode = $app->get('force_ssl', 0) == 2 ? 1 : -1; - $data['activate'] = Route::link('site', 'index.php?option=com_users&task=registration.activate&token=' . $data['activation'], false, $linkMode); + $data['activate'] = Route::link('site', + 'index.php?option=com_users&task=registration.activate&token=' . $data['activation'], + false, + $linkMode + ); $emailSubject = Text::sprintf( 'COM_USERS_EMAIL_ACCOUNT_DETAILS', @@ -562,7 +570,11 @@ class RegistrationModel extends FormModel // Set the link to activate the user account. $linkMode = $app->get('force_ssl', 0) == 2 ? 1 : -1; - $data['activate'] = Route::link('site', 'index.php?option=com_users&task=registration.activate&token=' . $data['activation'], false, $linkMode); + $data['activate'] = Route::link('site', + 'index.php?option=com_users&task=registration.activate&token=' . $data['activation'], + false, + $linkMode + ); $emailSubject = Text::sprintf( 'COM_USERS_EMAIL_ACCOUNT_DETAILS', diff --git a/installation/src/Form/Field/Installation/SampleField.php b/installation/src/Form/Field/Installation/SampleField.php index 38c4486cfe5..e725b060e4b 100644 --- a/installation/src/Form/Field/Installation/SampleField.php +++ b/installation/src/Form/Field/Installation/SampleField.php @@ -41,8 +41,9 @@ class SampleField extends RadioField */ protected function getOptions() { - $options = array(); - $type = $this->form->getValue('db_type'); + $options = array(); + $type = $this->form->getValue('db_type'); + $language = Factory::getLanguage(); // Some database drivers share DDLs; point these drivers to the correct parent if ($type === 'mysqli') @@ -71,7 +72,7 @@ class SampleField extends RadioField { foreach ($files as $file) { - $options[] = HTMLHelper::_('select.option', $file, Factory::getLanguage()->hasKey($key = 'INSTL_' . ($file = File::stripExt($file)) . '_SET') ? + $options[] = HTMLHelper::_('select.option', $file, $language->hasKey($key = 'INSTL_' . ($file = File::stripExt($file)) . '_SET') ? HTMLHelper::_('tooltip', Text::_('INSTL_' . strtoupper($file = File::stripExt($file)) . '_SET_DESC'), '', '', Text::_('JYES') ) : $file diff --git a/installation/src/Model/DatabaseModel.php b/installation/src/Model/DatabaseModel.php index fb94e016991..a731f50d25a 100644 --- a/installation/src/Model/DatabaseModel.php +++ b/installation/src/Model/DatabaseModel.php @@ -411,7 +411,9 @@ class DatabaseModel extends BaseInstallationModel } else { - throw new \RuntimeException(Text::sprintf('INSTL_DATABASE_INVALID_' . strtoupper($type) . '_VERSION', $db->getMinimum(), $db_version)); + throw new \RuntimeException( + Text::sprintf('INSTL_DATABASE_INVALID_' . strtoupper($type) . '_VERSION', $db->getMinimum(), $db_version) + ); } } @@ -674,7 +676,10 @@ class DatabaseModel extends BaseInstallationModel { if (!$installer->refreshManifestCache($extension->extension_id)) { - Factory::getApplication()->enqueueMessage(Text::sprintf('INSTL_DATABASE_COULD_NOT_REFRESH_MANIFEST_CACHE', $extension->name), 'error'); + Factory::getApplication()->enqueueMessage( + Text::sprintf('INSTL_DATABASE_COULD_NOT_REFRESH_MANIFEST_CACHE', $extension->name), + 'error' + ); return false; } diff --git a/libraries/src/Document/Renderer/Html/MetasRenderer.php b/libraries/src/Document/Renderer/Html/MetasRenderer.php index 50b18f83fcb..e7bae9a1fa5 100644 --- a/libraries/src/Document/Renderer/Html/MetasRenderer.php +++ b/libraries/src/Document/Renderer/Html/MetasRenderer.php @@ -83,11 +83,13 @@ class MetasRenderer extends DocumentRenderer { if ($type == 'http-equiv' && !($this->_doc->isHtml5() && $name == 'content-type')) { - $buffer .= $tab . '' . $lnEnd; + $buffer .= $tab . '' . $lnEnd; } elseif ($type != 'http-equiv' && !empty($contents)) { - $buffer .= $tab . '' . $lnEnd; + $buffer .= $tab . '' . $lnEnd; } } } diff --git a/libraries/src/Installer/Adapter/ComponentAdapter.php b/libraries/src/Installer/Adapter/ComponentAdapter.php index 5760ea15529..7d13165ecfe 100644 --- a/libraries/src/Installer/Adapter/ComponentAdapter.php +++ b/libraries/src/Installer/Adapter/ComponentAdapter.php @@ -1304,7 +1304,8 @@ class ComponentAdapter extends InstallerAdapter ->where('(' . $db->quoteName('link') . ' LIKE ' . $db->quote('index.php?option=' . $option) . ' OR ' . $db->quoteName('link') . ' LIKE ' . $db->quote($db->escape('index.php?option=' . $option . '&') . '%', false) - . ')'); + . ')' + ); if (isset($clientId)) { diff --git a/libraries/src/Installer/Adapter/LanguageAdapter.php b/libraries/src/Installer/Adapter/LanguageAdapter.php index 11a19dd2db6..848920d58a2 100644 --- a/libraries/src/Installer/Adapter/LanguageAdapter.php +++ b/libraries/src/Installer/Adapter/LanguageAdapter.php @@ -288,9 +288,9 @@ class LanguageAdapter extends InstallerAdapter { $this->parent ->setPath( - 'source', - ($this->parent->extension->client_id ? JPATH_ADMINISTRATOR : JPATH_SITE) . '/language/' . $this->parent->extension->element - ); + 'source', + ($this->parent->extension->client_id ? JPATH_ADMINISTRATOR : JPATH_SITE) . '/language/' . $this->parent->extension->element + ); } $this->setManifest($this->parent->getManifest()); @@ -386,11 +386,11 @@ class LanguageAdapter extends InstallerAdapter { $this->parent ->abort( - Text::sprintf( - 'JLIB_INSTALLER_ABORT', - Text::sprintf('JLIB_INSTALLER_ERROR_CREATE_FOLDER_FAILED', $this->parent->getPath('extension_site')) - ) - ); + Text::sprintf( + 'JLIB_INSTALLER_ABORT', + Text::sprintf('JLIB_INSTALLER_ERROR_CREATE_FOLDER_FAILED', $this->parent->getPath('extension_site')) + ) + ); return false; } diff --git a/libraries/src/Installer/Adapter/LibraryAdapter.php b/libraries/src/Installer/Adapter/LibraryAdapter.php index 9a553393ae2..d84344a9fae 100644 --- a/libraries/src/Installer/Adapter/LibraryAdapter.php +++ b/libraries/src/Installer/Adapter/LibraryAdapter.php @@ -44,7 +44,9 @@ class LibraryAdapter extends InstallerAdapter if ($this->parent->isOverwrite() || $this->parent->isUpgrade()) { // We can upgrade, so uninstall the old one - $installer = new Installer; // we don't want to compromise this instance! + + // We don't want to compromise this instance! + $installer = new Installer; $installer->setPackageUninstall(true); $installer->uninstall('library', $this->currentExtensionId); diff --git a/libraries/src/Installer/Installer.php b/libraries/src/Installer/Installer.php index b114896e774..20cd3b77951 100644 --- a/libraries/src/Installer/Installer.php +++ b/libraries/src/Installer/Installer.php @@ -2126,7 +2126,7 @@ class Installer extends \JAdapter { case 'folder': // Add any folders to the list - $folders[] = (string) $file; // add any folders to the list + $folders[] = (string) $file; break; case 'file': @@ -2188,7 +2188,7 @@ class Installer extends \JAdapter if (!in_array(dirname((string) $file), $folders)) { // Look if the file is now potentially in a folder - $files_deleted[] = (string) $file; // not in a folder, doesn't exist, wipe it out! + $files_deleted[] = (string) $file; } } break; diff --git a/libraries/src/MVC/Model/BaseDatabaseModel.php b/libraries/src/MVC/Model/BaseDatabaseModel.php index 98c306dd2e9..b53649eae32 100644 --- a/libraries/src/MVC/Model/BaseDatabaseModel.php +++ b/libraries/src/MVC/Model/BaseDatabaseModel.php @@ -108,6 +108,7 @@ abstract class BaseDatabaseModel extends BaseModel implements DatabaseModelInter if ($factory) { $this->setMVCFactory($factory); + return; } diff --git a/libraries/src/Menu/SiteMenu.php b/libraries/src/Menu/SiteMenu.php index d5d7109cb58..2d215f54bfb 100644 --- a/libraries/src/Menu/SiteMenu.php +++ b/libraries/src/Menu/SiteMenu.php @@ -84,7 +84,7 @@ class SiteMenu extends AbstractMenu $currentDate = Factory::getDate()->toSql(); $query = $this->db->getQuery(true) ->select('m.id, m.menutype, m.title, m.alias, m.note, m.path AS route, m.link, m.type, m.level, m.language') - ->select($this->db->quoteName('m.browserNav') . ', m.access, m.params, m.home, m.img, m.template_style_id, m.component_id, m.parent_id') + ->select($this->db->qn('m.browserNav') . ', m.access, m.params, m.home, m.img, m.template_style_id, m.component_id, m.parent_id') ->select('e.element as component') ->from('#__menu AS m') ->join('LEFT', '#__extensions AS e ON m.component_id = e.extension_id') @@ -104,7 +104,8 @@ class SiteMenu extends AbstractMenu try { /** @var CallbackController $cache */ - $cache = Factory::getContainer()->get(CacheControllerFactoryInterface::class)->createCacheController('callback', ['defaultgroup' => 'com_menus']); + $cache = Factory::getContainer()->get(CacheControllerFactoryInterface::class) + ->createCacheController('callback', ['defaultgroup' => 'com_menus']); $this->items = $cache->get($loader, array(), md5(get_class($this)), false); } diff --git a/libraries/src/Schema/ChangeItem/MysqlChangeItem.php b/libraries/src/Schema/ChangeItem/MysqlChangeItem.php index 0a2c71e4a60..947660a10a2 100644 --- a/libraries/src/Schema/ChangeItem/MysqlChangeItem.php +++ b/libraries/src/Schema/ChangeItem/MysqlChangeItem.php @@ -41,7 +41,7 @@ class MysqlChangeItem extends ChangeItem { // Initialize fields in case we can't create a check query - // change status to skipped + // Change status to skipped $this->checkStatus = -1; $result = null; diff --git a/libraries/src/Schema/ChangeItem/PostgresqlChangeItem.php b/libraries/src/Schema/ChangeItem/PostgresqlChangeItem.php index 2af095e5f37..47f6a50599a 100644 --- a/libraries/src/Schema/ChangeItem/PostgresqlChangeItem.php +++ b/libraries/src/Schema/ChangeItem/PostgresqlChangeItem.php @@ -40,7 +40,7 @@ class PostgresqlChangeItem extends ChangeItem { // Initialize fields in case we can't create a check query - // change status to skipped + // Change status to skipped $this->checkStatus = -1; $result = null; diff --git a/libraries/src/Schema/ChangeItem/SqlsrvChangeItem.php b/libraries/src/Schema/ChangeItem/SqlsrvChangeItem.php index e1ab2a43316..fddd2482c76 100644 --- a/libraries/src/Schema/ChangeItem/SqlsrvChangeItem.php +++ b/libraries/src/Schema/ChangeItem/SqlsrvChangeItem.php @@ -40,7 +40,7 @@ class SqlsrvChangeItem extends ChangeItem { // Initialize fields in case we can't create a check query - // change status to skipped + // Change status to skipped $this->checkStatus = -1; $result = null; diff --git a/libraries/src/Session/Session.php b/libraries/src/Session/Session.php index 2e9d8c8a9a4..f1bd7b1cbf9 100644 --- a/libraries/src/Session/Session.php +++ b/libraries/src/Session/Session.php @@ -119,7 +119,8 @@ class Session extends BaseSession if (!empty($args[2])) { Log::add( - 'Passing a namespace as a parameter to ' . __METHOD__ . '() is deprecated. The namespace should be prepended to the name instead.', + 'Passing a namespace as a parameter to ' . __METHOD__ . '() is deprecated. ' + . 'The namespace should be prepended to the name instead.', Log::WARNING, 'deprecated' ); @@ -151,7 +152,8 @@ class Session extends BaseSession if (!empty($args[2])) { Log::add( - 'Passing a namespace as a parameter to ' . __METHOD__ . '() is deprecated. The namespace should be prepended to the name instead.', + 'Passing a namespace as a parameter to ' . __METHOD__ . '() is deprecated. ' + . 'The namespace should be prepended to the name instead.', Log::WARNING, 'deprecated' ); @@ -182,7 +184,8 @@ class Session extends BaseSession if (!empty($args[1])) { Log::add( - 'Passing a namespace as a parameter to ' . __METHOD__ . '() is deprecated. The namespace should be prepended to the name instead.', + 'Passing a namespace as a parameter to ' . __METHOD__ . '() is deprecated. ' + . 'The namespace should be prepended to the name instead.', Log::WARNING, 'deprecated' ); @@ -222,7 +225,8 @@ class Session extends BaseSession if (func_num_args() > 1 && !empty($args[1])) { Log::add( - 'Passing a namespace as a parameter to ' . __METHOD__ . '() is deprecated. The namespace should be prepended to the name instead.', + 'Passing a namespace as a parameter to ' . __METHOD__ . '() is deprecated. ' + . 'The namespace should be prepended to the name instead.', Log::WARNING, 'deprecated' ); diff --git a/libraries/src/Toolbar/Button/DropdownButton.php b/libraries/src/Toolbar/Button/DropdownButton.php index 7037a88007c..0099257ab67 100644 --- a/libraries/src/Toolbar/Button/DropdownButton.php +++ b/libraries/src/Toolbar/Button/DropdownButton.php @@ -88,7 +88,7 @@ class DropdownButton extends AbstractGroupButton /** * Render button HTML. * - * @param array &$options The button options. + * @param array $options The button options. * * @return string The button HTML. * diff --git a/modules/mod_menu/Helper/MenuHelper.php b/modules/mod_menu/Helper/MenuHelper.php index 3c35c227273..340e2edb398 100644 --- a/modules/mod_menu/Helper/MenuHelper.php +++ b/modules/mod_menu/Helper/MenuHelper.php @@ -44,7 +44,8 @@ class MenuHelper $key = 'menu_items' . $params . implode(',', $levels) . '.' . $base->id; /** @var OutputController $cache */ - $cache = Factory::getContainer()->get(CacheControllerFactoryInterface::class)->createCacheController('output', ['defaultgroup' => 'mod_menu']); + $cache = Factory::getContainer()->get(CacheControllerFactoryInterface::class) + ->createCacheController('output', ['defaultgroup' => 'mod_menu']); if ($cache->contains($key)) { diff --git a/plugins/system/remember/remember.php b/plugins/system/remember/remember.php index ebfb6c9f8a2..95ff0acf0ca 100644 --- a/plugins/system/remember/remember.php +++ b/plugins/system/remember/remember.php @@ -128,13 +128,14 @@ class PlgSystemRemember extends CMSPlugin } /* - * But now, we need to do something + * But now, we need to do something * Delete all tokens for this user! */ $db = Factory::getDbo(); $query = $db->getQuery(true) ->delete('#__user_keys') ->where($db->quoteName('user_id') . ' = ' . $db->quote($user['username'])); + try { $db->setQuery($query)->execute(); diff --git a/plugins/system/updatenotification/updatenotification.php b/plugins/system/updatenotification/updatenotification.php index 1eda934e7a2..9b5fa046008 100644 --- a/plugins/system/updatenotification/updatenotification.php +++ b/plugins/system/updatenotification/updatenotification.php @@ -94,11 +94,11 @@ class PlgSystemUpdatenotification extends CMSPlugin $this->params->set('lastrun', $now); $query = $this->db->getQuery(true) - ->update($this->db->quoteName('#__extensions')) - ->set($this->db->quoteName('params') . ' = ' . $this->db->quote($this->params->toString('JSON'))) - ->where($this->db->quoteName('type') . ' = ' . $this->db->quote('plugin')) - ->where($this->db->quoteName('folder') . ' = ' . $this->db->quote('system')) - ->where($this->db->quoteName('element') . ' = ' . $this->db->quote('updatenotification')); + ->update($this->db->quoteName('#__extensions')) + ->set($this->db->quoteName('params') . ' = ' . $this->db->quote($this->params->toString('JSON'))) + ->where($this->db->quoteName('type') . ' = ' . $this->db->quote('plugin')) + ->where($this->db->quoteName('folder') . ' = ' . $this->db->quote('system')) + ->where($this->db->quoteName('element') . ' = ' . $this->db->quote('updatenotification')); try { @@ -361,9 +361,9 @@ class PlgSystemUpdatenotification extends CMSPlugin try { $query = $this->db->getQuery(true) - ->select($this->db->quoteName('user_id')) - ->from($this->db->quoteName('#__user_usergroup_map')) - ->where($this->db->quoteName('group_id') . ' IN(' . implode(',', $groups) . ')'); + ->select($this->db->quoteName('user_id')) + ->from($this->db->quoteName('#__user_usergroup_map')) + ->where($this->db->quoteName('group_id') . ' IN(' . implode(',', $groups) . ')'); $this->db->setQuery($query); $rawUserIDs = $this->db->loadColumn(0); @@ -388,16 +388,16 @@ class PlgSystemUpdatenotification extends CMSPlugin try { $query = $this->db->getQuery(true) - ->select( - array( - $this->db->quoteName('id'), - $this->db->quoteName('username'), - $this->db->quoteName('email'), - ) - )->from($this->db->quoteName('#__users')) - ->where($this->db->quoteName('id') . ' IN(' . implode(',', $userIDs) . ')') - ->where($this->db->quoteName('block') . ' = 0') - ->where($this->db->quoteName('sendEmail') . ' = ' . $this->db->quote('1')); + ->select( + array( + $this->db->quoteName('id'), + $this->db->quoteName('username'), + $this->db->quoteName('email'), + ) + )->from($this->db->quoteName('#__users')) + ->where($this->db->quoteName('id') . ' IN(' . implode(',', $userIDs) . ')') + ->where($this->db->quoteName('block') . ' = 0') + ->where($this->db->quoteName('sendEmail') . ' = ' . $this->db->quote('1')); if (!empty($emails)) { diff --git a/plugins/user/terms/terms.php b/plugins/user/terms/terms.php index ca5a9fa3979..58c74f6c93e 100644 --- a/plugins/user/terms/terms.php +++ b/plugins/user/terms/terms.php @@ -167,7 +167,7 @@ class PlgUserTerms extends CMSPlugin 'accountlink' => 'index.php?option=com_users&task=user.edit&id=' . $userId, ); - /* @var ActionlogsModelActionlog $model */ + /** @var ActionlogsModelActionlog $model */ $model = BaseDatabaseModel::getInstance('Actionlog', 'ActionlogsModel'); $model->addLog(array($message), 'PLG_USER_TERMS_LOGGING_CONSENT_TO_TERMS', 'plg_user_terms', $userId); } diff --git a/templates/cassiopeia/index.php b/templates/cassiopeia/index.php index 6e4d83a3434..2086527100f 100644 --- a/templates/cassiopeia/index.php +++ b/templates/cassiopeia/index.php @@ -52,12 +52,12 @@ else $hasClass = ''; -if ($this->countModules('sidebar-left')) +if ($this->countModules('sidebar-left')) { $hasClass .= ' has-sidebar-left'; } -if ($this->countModules('sidebar-right')) +if ($this->countModules('sidebar-right')) { $hasClass .= ' has-sidebar-right'; }