refactor: finish refactoring

This commit is contained in:
Ben Goldsworthy 2021-08-09 11:27:13 +01:00
parent facda599bb
commit fbb00fab2f
30 changed files with 599 additions and 108 deletions

View file

@ -10,8 +10,6 @@ declare(strict_types=1);
namespace footnotes\includes\settings\customcss;
require_once plugin_dir_path( __DIR__ ) . 'class-settings-section.php';
use footnotes\includes\Settings;
use footnotes\includes\settings\SettingsSection;
@ -34,6 +32,15 @@ class CustomCSSSettingsSection extends SettingsSection {
*/
protected array $settings_groups;
/**
* Constructs the settings section.
*
* @param string options_group_slug The slug of the settings section's options group.
* @param string section_slug The slug of the settings section.
* @param string title The name of the settings section.
*
* @since 2.8.0
*/
public function __construct(
$options_group_slug,
$section_slug,
@ -57,13 +64,28 @@ class CustomCSSSettingsSection extends SettingsSection {
$this->load_options_group();
}
/**
* Load the required dependencies.
*
* Include the following files that provide the settings for this section:
*
* - {@see SettingsSection}: defines a settings section; and
* - {@see CustomCSSSettingsGroup}.
*
* @see SettingsSection::load_dependencies()
*/
protected function load_dependencies(): void {
parent::load_dependencies();
require_once plugin_dir_path( __DIR__ ) . 'class-settings-section.php';
require_once plugin_dir_path( __DIR__ ) . 'custom-css/class-custom-css-settings-group.php';
}
/**
* @see SettingsSection::add_settings_groups()
*/
protected function add_settings_groups(): void {
$this->settings_groups = array (
CustomCSSSettingsGroup::GROUP_ID => new CustomCSSSettingsGroup($this->options_group_slug, $this->section_slug, $this->settings ),