Fix SonarQube code quality issues to improve rating from B to A
This commit is contained in:
@@ -13,10 +13,20 @@ namespace WPALLSTARS\PluginStarterTemplate;
|
||||
class Core {
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* Plugin version
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public function __construct() {
|
||||
private $version;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string $version Plugin version.
|
||||
*/
|
||||
public function __construct( $version = '' ) {
|
||||
// Initialize hooks.
|
||||
$this->version = $version;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -28,4 +38,13 @@ class Core {
|
||||
public function filter_content( $content ) {
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the plugin version
|
||||
*
|
||||
* @return string The plugin version.
|
||||
*/
|
||||
public function get_plugin_version() {
|
||||
return $this->version;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ class Plugin {
|
||||
public function __construct( $plugin_file, $version ) {
|
||||
$this->plugin_file = $plugin_file;
|
||||
$this->version = $version;
|
||||
$this->core = new Core();
|
||||
$this->core = new Core( $version );
|
||||
$this->admin = new Admin( $this->core );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user