refactor: upgrade to PHP 8.0
This commit is contained in:
parent
4afbb94003
commit
39871b6cd0
7 changed files with 42 additions and 92 deletions
|
@ -28,26 +28,6 @@ use footnotes\includes as Includes;
|
|||
*/
|
||||
class Admin {
|
||||
|
||||
/**
|
||||
* The ID of this plugin.
|
||||
*
|
||||
* @access private
|
||||
* @since 2.8.0
|
||||
* @see Includes\Footnotes::$plugin_name
|
||||
* @var string $plugin_name The ID of this plugin.
|
||||
*/
|
||||
private string $plugin_name;
|
||||
|
||||
/**
|
||||
* The version of this plugin.
|
||||
*
|
||||
* @access private
|
||||
* @since 2.8.0
|
||||
* @see Includes\Footnotes::$version
|
||||
* @var string $version The current version of this plugin.
|
||||
*/
|
||||
private string $version;
|
||||
|
||||
/**
|
||||
* The WYSIWYG editor integration object.
|
||||
*
|
||||
|
@ -58,16 +38,26 @@ class Admin {
|
|||
|
||||
/**
|
||||
* Initialize the class and set its properties.
|
||||
|
||||
* @param string $plugin_name The name of this plugin.
|
||||
* @param string $version The version of this plugin.
|
||||
*
|
||||
* @since 2.8.0
|
||||
*/
|
||||
public function __construct( string $plugin_name, string $version ) {
|
||||
|
||||
$this->plugin_name = $plugin_name;
|
||||
$this->version = $version;
|
||||
public function __construct( /**
|
||||
* The ID of this plugin.
|
||||
*
|
||||
* @access private
|
||||
* @since 2.8.0
|
||||
* @see Includes\Footnotes::$plugin_name
|
||||
* @var string $plugin_name The ID of this plugin.
|
||||
*/
|
||||
private string $plugin_name, /**
|
||||
* The version of this plugin.
|
||||
*
|
||||
* @access private
|
||||
* @since 2.8.0
|
||||
* @see Includes\Footnotes::$version
|
||||
* @var string $version The current version of this plugin.
|
||||
*/
|
||||
private string $version ) {
|
||||
|
||||
$this->load_dependencies();
|
||||
|
||||
|
|
|
@ -65,7 +65,6 @@ abstract class Engine {
|
|||
* Returns a Priority index. Lower numbers have a higher priority.
|
||||
*
|
||||
* @abstract
|
||||
* @return int
|
||||
*
|
||||
* @since 1.5.0
|
||||
*/
|
||||
|
@ -76,7 +75,6 @@ abstract class Engine {
|
|||
*
|
||||
* @abstract
|
||||
* @access protected
|
||||
* @return string
|
||||
*
|
||||
* @since 1.5.0
|
||||
*/
|
||||
|
@ -87,7 +85,6 @@ abstract class Engine {
|
|||
*
|
||||
* @abstract
|
||||
* @access protected
|
||||
* @return string
|
||||
*
|
||||
* @since 1.5.0
|
||||
*/
|
||||
|
@ -98,7 +95,6 @@ abstract class Engine {
|
|||
*
|
||||
* @abstract
|
||||
* @access protected
|
||||
* @return array
|
||||
*
|
||||
* @since 1.5.0
|
||||
*/
|
||||
|
@ -109,7 +105,6 @@ abstract class Engine {
|
|||
*
|
||||
* @abstract
|
||||
* @access protected
|
||||
* @return array
|
||||
*
|
||||
* @since 1.5.0
|
||||
*/
|
||||
|
@ -387,7 +382,6 @@ abstract class Engine {
|
|||
*
|
||||
* @access protected
|
||||
* @param string $p_str_text Message to be surrounded with `<span>` tags.
|
||||
* @return string
|
||||
*
|
||||
* @since 1.5.0
|
||||
* @todo Refactor HTML generation.
|
||||
|
@ -402,7 +396,6 @@ abstract class Engine {
|
|||
* @access protected
|
||||
* @param string $p_str_setting_name Settings key.
|
||||
* @param string $p_str_caption Label caption.
|
||||
* @return string
|
||||
*
|
||||
* @since 1.5.0
|
||||
* @todo Refactor HTML generation.
|
||||
|
@ -434,7 +427,6 @@ abstract class Engine {
|
|||
* @param int $p_str_max_length Maximum length of the input. Default length 999 chars.
|
||||
* @param bool $p_bool_readonly Set the input to be read only. Default `false`.
|
||||
* @param bool $p_bool_hidden Set the input to be hidden. Default `false`.
|
||||
* @return string
|
||||
*
|
||||
* @since 1.5.0
|
||||
* @todo Refactor HTML generation.
|
||||
|
@ -462,7 +454,6 @@ abstract class Engine {
|
|||
*
|
||||
* @access protected
|
||||
* @param string $p_str_setting_name Setting key.
|
||||
* @return string
|
||||
*
|
||||
* @since 1.5.0
|
||||
* @todo Refactor HTML generation.
|
||||
|
@ -484,7 +475,6 @@ abstract class Engine {
|
|||
* @access protected
|
||||
* @param string $p_str_setting_name Setting key.
|
||||
* @param array $p_arr_options Possible options.
|
||||
* @return string
|
||||
*
|
||||
* @since 1.5.0
|
||||
* @todo Refactor HTML generation.
|
||||
|
@ -519,7 +509,6 @@ abstract class Engine {
|
|||
*
|
||||
* @access protected
|
||||
* @param string $p_str_setting_name Setting key.
|
||||
* @return string
|
||||
*
|
||||
* @since 1.5.0
|
||||
* @todo Refactor HTML generation.
|
||||
|
@ -541,7 +530,6 @@ abstract class Engine {
|
|||
*
|
||||
* @access protected
|
||||
* @param string $p_str_setting_name Setting key.
|
||||
* @return string
|
||||
*
|
||||
* @since 1.5.6
|
||||
* @todo Refactor HTML generation.
|
||||
|
@ -566,7 +554,6 @@ abstract class Engine {
|
|||
* @param int $p_in_min Minimum value.
|
||||
* @param int $p_int_max Maximum value.
|
||||
* @param bool $p_bool_deci `true` if float, `false` if integer. Default `false`.
|
||||
* @return string
|
||||
*
|
||||
* @since 1.5.0
|
||||
* @todo Refactor HTML generation.
|
||||
|
|
|
@ -27,16 +27,6 @@ use footnotes\includes as Includes;
|
|||
*/
|
||||
class Init {
|
||||
|
||||
/**
|
||||
* The ID of this plugin.
|
||||
*
|
||||
* @access private
|
||||
* @var string $plugin_name The ID of this plugin.
|
||||
*
|
||||
* @since 2.8.0
|
||||
*/
|
||||
private string $plugin_name;
|
||||
|
||||
/**
|
||||
* Slug for the Plugin main menu.
|
||||
*
|
||||
|
@ -58,14 +48,19 @@ class Init {
|
|||
/**
|
||||
* Initializes all WordPress hooks for the Plugin Settings.
|
||||
*
|
||||
* @param string $plugin_name The name of the plugin.
|
||||
*
|
||||
* @since 1.5.0
|
||||
* @since 2.8.0 Added `$plugin_name` parameter.
|
||||
*/
|
||||
public function __construct( string $plugin_name ) {
|
||||
$this->plugin_name = $plugin_name;
|
||||
|
||||
public function __construct( /**
|
||||
* The ID of this plugin.
|
||||
*
|
||||
* @access private
|
||||
* @var string $plugin_name The ID of this plugin.
|
||||
*
|
||||
* @since 2.8.0
|
||||
*/
|
||||
private string $plugin_name ) {
|
||||
$this->load_dependencies();
|
||||
|
||||
$this->settings_page = new Settings( $this->plugin_name );
|
||||
|
|
Reference in a new issue