From 765543832880fd1433ac149e58959022818bcf90 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Wed, 24 Apr 2024 09:17:21 +0200 Subject: [PATCH] Installation: move getOptions() to base class --- installation/src/Model/BaseInstallationModel.php | 13 +++++++++++++ installation/src/Model/ChecksModel.php | 14 -------------- installation/src/Model/DatabaseModel.php | 12 ------------ installation/src/Model/LanguagesModel.php | 12 ------------ installation/src/Model/SetupModel.php | 14 -------------- 5 files changed, 13 insertions(+), 52 deletions(-) diff --git a/installation/src/Model/BaseInstallationModel.php b/installation/src/Model/BaseInstallationModel.php index d8ec4c2fff949..f31e319495464 100644 --- a/installation/src/Model/BaseInstallationModel.php +++ b/installation/src/Model/BaseInstallationModel.php @@ -10,6 +10,7 @@ namespace Joomla\CMS\Installation\Model; +use Joomla\CMS\Factory; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\BaseDatabaseModel; @@ -40,4 +41,16 @@ public function __construct($config = [], MVCFactoryInterface $factory = null) parent::__construct($config, $factory); } + + /** + * Get the current setup options from the session. + * + * @return array An array of options from the session. + * + * @since 3.1 + */ + public function getOptions() + { + return Factory::getSession()->get('setup.options', []); + } } diff --git a/installation/src/Model/ChecksModel.php b/installation/src/Model/ChecksModel.php index b393a222c8e3e..cc3cd4bf02943 100644 --- a/installation/src/Model/ChecksModel.php +++ b/installation/src/Model/ChecksModel.php @@ -217,20 +217,6 @@ public function getPhpSettings() return $settings; } - /** - * Get the current setup options from the session. - * - * @return array An array of options from the session. - * - * @since 3.1 - */ - public function getOptions() - { - if (!empty(Factory::getSession()->get('setup.options', []))) { - return Factory::getSession()->get('setup.options', []); - } - } - /** * Method to get the form. * diff --git a/installation/src/Model/DatabaseModel.php b/installation/src/Model/DatabaseModel.php index d00e69737546a..2b3038eeaa538 100644 --- a/installation/src/Model/DatabaseModel.php +++ b/installation/src/Model/DatabaseModel.php @@ -29,18 +29,6 @@ */ class DatabaseModel extends BaseInstallationModel { - /** - * Get the current setup options from the session. - * - * @return array An array of options from the session. - * - * @since 4.0.0 - */ - public function getOptions() - { - return Factory::getSession()->get('setup.options', []); - } - /** * Method to initialise the database. * diff --git a/installation/src/Model/LanguagesModel.php b/installation/src/Model/LanguagesModel.php index f63c9198ee3a1..e07acd8d691df 100644 --- a/installation/src/Model/LanguagesModel.php +++ b/installation/src/Model/LanguagesModel.php @@ -490,18 +490,6 @@ public function setDefault($language, $clientName = 'administrator') return true; } - /** - * Get the current setup options from the session. - * - * @return array - * - * @since 3.1 - */ - public function getOptions() - { - return Factory::getSession()->get('setup.options', []); - } - /** * Get the model form. * diff --git a/installation/src/Model/SetupModel.php b/installation/src/Model/SetupModel.php index 9cb32473d9c7e..14cb848722fbc 100644 --- a/installation/src/Model/SetupModel.php +++ b/installation/src/Model/SetupModel.php @@ -28,20 +28,6 @@ */ class SetupModel extends BaseInstallationModel { - /** - * Get the current setup options from the session. - * - * @return array An array of options from the session. - * - * @since 3.1 - */ - public function getOptions() - { - if (!empty(Factory::getSession()->get('setup.options', []))) { - return Factory::getSession()->get('setup.options', []); - } - } - /** * Store the current setup options in the session. *