Skip to content
Snippets Groups Projects
Commit 609b7730 authored by Erick Hitter's avatar Erick Hitter
Browse files

PHPCS

parent 9f4b2465
No related branches found
No related tags found
1 merge request!14Add native block-editor support
Pipeline #4804 failed with stages
in 2 minutes and 10 seconds
......@@ -25,7 +25,7 @@
*/
// Include singleton trait used by all classes.
require_once dirname( __FILE__ ) . '/inc/trait-singleton.php';
require_once dirname( __FILE__ ) . '/inc/class-external-permalinks-redux-singleton.php';
// Include block-editor class.
require_once dirname( __FILE__ ) . '/inc/class-external-permalinks-redux-block-editor.php';
......@@ -34,9 +34,7 @@ require_once dirname( __FILE__ ) . '/inc/class-external-permalinks-redux-block-e
* Class external_permalinks_redux.
*/
// phpcs:ignore PEAR.NamingConventions.ValidClassName, Squiz.Commenting.ClassComment.Missing
class external_permalinks_redux {
use External_Permalinks_Redux_Singleton;
class external_permalinks_redux extends External_Permalinks_Redux_Singleton{
/**
* Redirect URL meta key.
*
......
......@@ -8,9 +8,7 @@
/**
* Class Block_Editor.
*/
class External_Permalinks_Redux_Block_Editor {
use External_Permalinks_Redux_Singleton;
class External_Permalinks_Redux_Block_Editor extends External_Permalinks_Redux_Singleton {
/**
* Set up class.
*
......
<?php
/**
* Singleton trait.
* Singleton base class.
*
* @package External_Permalinks_Redux
*/
trait External_Permalinks_Redux_Singleton {
abstract class External_Permalinks_Redux_Singleton {
/**
* Singleton!
*
......@@ -19,12 +19,12 @@ trait External_Permalinks_Redux_Singleton {
* @return object
*/
public static function get_instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self();
self::$instance->_setup();
if ( ! isset( static::$instance ) ) {
static::$instance = new static();
static::$instance->_setup();
}
return self::$instance;
return static::$instance;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment