Skip to content

Commit

Permalink
Installation: move getOptions() to base class (#43356)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackwar authored Aug 13, 2024
1 parent 42680c6 commit c1054fd
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 52 deletions.
13 changes: 13 additions & 0 deletions installation/src/Model/BaseInstallationModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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', []);
}
}
14 changes: 0 additions & 14 deletions installation/src/Model/ChecksModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
12 changes: 0 additions & 12 deletions installation/src/Model/DatabaseModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
12 changes: 0 additions & 12 deletions installation/src/Model/LanguagesModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
14 changes: 0 additions & 14 deletions installation/src/Model/SetupModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit c1054fd

Please sign in to comment.