Use new code style

This commit is contained in:
David Stone
2025-02-07 19:02:33 -07:00
parent 0181024ae1
commit 8433379d90
672 changed files with 37107 additions and 45249 deletions

View File

@ -28,17 +28,14 @@ trait Singleton {
*/
public static function get_instance() {
if (!static::$instance instanceof static) {
if ( ! static::$instance instanceof static) {
static::$instance = new static();
static::$instance->init();
} // end if;
}
return static::$instance;
} // end get_instance;
}
/**
* Runs only once, at the first instantiation of the Singleton.
@ -49,8 +46,7 @@ trait Singleton {
public function init() {
$this->has_parents() && method_exists(get_parent_class($this), 'init') && parent::init();
} // end init;
}
/**
* Check if the current class has parents.
@ -61,7 +57,5 @@ trait Singleton {
public function has_parents() {
return (bool) class_parents($this);
} // end has_parents;
} // end trait Singleton;
}
}