refactor: run Rector CODE_QUALITY rulesets

Fix #168
This commit is contained in:
Ben Goldsworthy 2021-05-02 10:45:52 +01:00
parent 4299a71df5
commit 1728e0fcd5
9 changed files with 523 additions and 502 deletions

View file

@ -180,7 +180,7 @@ class Convert {
$l_arr_arrows = array( '↑', '↥', '↟', '↩', '↲', '↵', '⇑', '⇡', '⇧', '↑' );
// Convert index to an integer.
if ( ! is_int( $p_int_index ) ) {
$p_int_index = intval( $p_int_index );
$p_int_index = (int) $p_int_index;
}
// Return the whole arrow array.
if ( $p_int_index < 0 || $p_int_index > count( $l_arr_arrows ) ) {

View file

@ -86,11 +86,7 @@ class Core {
* @return void
*/
public function __construct() {
if ( defined( 'PLUGIN_VERSION' ) ) {
$this->version = PLUGIN_VERSION;
} else {
$this->version = '0.0.0';
}
$this->version = defined( 'PLUGIN_VERSION' ) ? PLUGIN_VERSION : '0.0.0';
$this->plugin_name = 'footnotes';
$this->load_dependencies();

View file

@ -1226,7 +1226,7 @@ class Settings {
'footnotes_storage_custom' => array(
// Backlink symbol.
self::C_STR_HYPERLINK_ARROW => '&#8593;',
self::C_STR_HYPERLINK_ARROW => 0,
self::C_STR_HYPERLINK_ARROW_USER_DEFINED => '',
// Referrers.
@ -1451,7 +1451,7 @@ class Settings {
* @since 1.5.0
*/
public function get( $p_str_key ) {
return array_key_exists( $p_str_key, $this->a_arr_settings ) ? $this->a_arr_settings[ $p_str_key ] : null;
return $this->a_arr_settings[ $p_str_key ] ?? null;
}
/**