diff --git a/includes/Abstracts/Abstract_Feature.php b/includes/Abstracts/Abstract_Feature.php index 06eba4a..5c9da20 100644 --- a/includes/Abstracts/Abstract_Feature.php +++ b/includes/Abstracts/Abstract_Feature.php @@ -5,6 +5,8 @@ * @package WordPress\AI\Abstracts */ +declare( strict_types=1 ); + namespace WordPress\AI\Abstracts; use WordPress\AI\Contracts\Feature; @@ -24,7 +26,7 @@ abstract class Abstract_Feature implements Feature { * @since 0.1.0 * @var string */ - protected $id; + protected string $id; /** * Feature label. @@ -32,7 +34,7 @@ abstract class Abstract_Feature implements Feature { * @since 0.1.0 * @var string */ - protected $label; + protected string $label; /** * Feature description. @@ -40,7 +42,7 @@ abstract class Abstract_Feature implements Feature { * @since 0.1.0 * @var string */ - protected $description; + protected string $description; /** * Whether the feature is enabled. @@ -48,7 +50,7 @@ abstract class Abstract_Feature implements Feature { * @since 0.1.0 * @var bool */ - private $enabled = true; + private bool $enabled = true; /** * Constructor. diff --git a/includes/Contracts/Feature.php b/includes/Contracts/Feature.php index 09ea9e0..a5e0640 100644 --- a/includes/Contracts/Feature.php +++ b/includes/Contracts/Feature.php @@ -5,6 +5,8 @@ * @package WordPress\AI\Contracts */ +declare( strict_types=1 ); + namespace WordPress\AI\Contracts; /** diff --git a/includes/Exception/Invalid_Feature_Exception.php b/includes/Exception/Invalid_Feature_Exception.php index 5c9c2f4..c898891 100644 --- a/includes/Exception/Invalid_Feature_Exception.php +++ b/includes/Exception/Invalid_Feature_Exception.php @@ -5,6 +5,8 @@ * @package WordPress\AI\Exception */ +declare( strict_types=1 ); + namespace WordPress\AI\Exception; use InvalidArgumentException; diff --git a/includes/Exception/Invalid_Feature_Metadata_Exception.php b/includes/Exception/Invalid_Feature_Metadata_Exception.php index f984134..894430a 100644 --- a/includes/Exception/Invalid_Feature_Metadata_Exception.php +++ b/includes/Exception/Invalid_Feature_Metadata_Exception.php @@ -5,6 +5,8 @@ * @package WordPress\AI\Exception */ +declare( strict_types=1 ); + namespace WordPress\AI\Exception; use InvalidArgumentException; diff --git a/includes/Feature_Loader.php b/includes/Feature_Loader.php index 14500e3..4d53c9a 100644 --- a/includes/Feature_Loader.php +++ b/includes/Feature_Loader.php @@ -5,6 +5,8 @@ * @package WordPress\AI */ +declare( strict_types=1 ); + namespace WordPress\AI; use Throwable; @@ -20,14 +22,14 @@ * * @since 0.1.0 */ -class Feature_Loader { +final class Feature_Loader { /** * Feature registry instance. * * @since 0.1.0 * @var \WordPress\AI\Feature_Registry */ - private $registry; + private \WordPress\AI\Feature_Registry $registry; /** * Whether features have been initialized. @@ -35,7 +37,7 @@ class Feature_Loader { * @since 0.1.0 * @var bool */ - private $initialized = false; + private bool $initialized = false; /** * Constructor. diff --git a/includes/Feature_Registry.php b/includes/Feature_Registry.php index 794ba58..a07a49e 100644 --- a/includes/Feature_Registry.php +++ b/includes/Feature_Registry.php @@ -5,6 +5,8 @@ * @package WordPress\AI */ +declare( strict_types=1 ); + namespace WordPress\AI; use WordPress\AI\Contracts\Feature; @@ -17,14 +19,14 @@ * * @since 0.1.0 */ -class Feature_Registry { +final class Feature_Registry { /** * Registered features. * * @since 0.1.0 * @var \WordPress\AI\Contracts\Feature[] */ - private $features = array(); + private array $features = array(); /** * Registers a feature. diff --git a/includes/Features/Example_Feature/Example_Feature.php b/includes/Features/Example_Feature/Example_Feature.php index c4ce5aa..a23ff99 100644 --- a/includes/Features/Example_Feature/Example_Feature.php +++ b/includes/Features/Example_Feature/Example_Feature.php @@ -5,6 +5,8 @@ * @package WordPress\AI */ +declare( strict_types=1 ); + namespace WordPress\AI\Features\Example_Feature; use WordPress\AI\Abstracts\Abstract_Feature; @@ -16,11 +18,9 @@ */ class Example_Feature extends Abstract_Feature { /** - * Loads feature metadata. + * {@inheritDoc} * * @since 0.1.0 - * - * @return array{id: string, label: string, description: string} Feature metadata. */ protected function load_feature_metadata(): array { return array( @@ -31,7 +31,7 @@ protected function load_feature_metadata(): array { } /** - * Registers the feature hooks. + * {@inheritDoc} * * @since 0.1.0 */ diff --git a/includes/bootstrap.php b/includes/bootstrap.php index 70e6537..17bf051 100644 --- a/includes/bootstrap.php +++ b/includes/bootstrap.php @@ -7,6 +7,8 @@ * @package WordPress\AI */ +declare( strict_types=1 ); + namespace WordPress\AI; // Exit if accessed directly.