Improve code quality to move from B to A grade

- Added proper type declarations to all properties and methods
- Fixed inconsistent variable naming (camelCase to snake_case)
- Improved path handling in admin class
- Added textdomain loading functionality
- Removed unused phpcs:ignore comment
- Implemented proper return type declarations
This commit is contained in:
2025-04-21 16:52:56 +01:00
parent af11f827c4
commit 40ebbce1cc
3 changed files with 31 additions and 16 deletions

View File

@@ -17,14 +17,14 @@ class Core {
*
* @var string
*/
private $version;
private string $version;
/**
* Constructor
*
* @param string $version Plugin version.
*/
public function __construct( $version = '' ) {
public function __construct( string $version = '' ) {
// Initialize hooks.
$this->version = $version;
}
@@ -35,7 +35,7 @@ class Core {
* @param string $content The content to filter.
* @return string The filtered content.
*/
public function filter_content( $content ) {
public function filter_content( string $content ): string {
return $content;
}
@@ -44,7 +44,7 @@ class Core {
*
* @return string The plugin version.
*/
public function get_plugin_version() {
public function get_plugin_version(): string {
return $this->version;
}
}