Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions includes/Abstracts/Abstract_Feature.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @package WordPress\AI\Abstracts
*/

declare( strict_types=1 );

namespace WordPress\AI\Abstracts;

use WordPress\AI\Contracts\Feature;
Expand All @@ -24,31 +26,31 @@ abstract class Abstract_Feature implements Feature {
* @since 0.1.0
* @var string
*/
protected $id;
protected string $id;

/**
* Feature label.
*
* @since 0.1.0
* @var string
*/
protected $label;
protected string $label;

/**
* Feature description.
*
* @since 0.1.0
* @var string
*/
protected $description;
protected string $description;

/**
* Whether the feature is enabled.
*
* @since 0.1.0
* @var bool
*/
private $enabled = true;
private bool $enabled = true;

/**
* Constructor.
Expand Down
2 changes: 2 additions & 0 deletions includes/Contracts/Feature.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @package WordPress\AI\Contracts
*/

declare( strict_types=1 );

namespace WordPress\AI\Contracts;

/**
Expand Down
2 changes: 2 additions & 0 deletions includes/Exception/Invalid_Feature_Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @package WordPress\AI\Exception
*/

declare( strict_types=1 );

namespace WordPress\AI\Exception;

use InvalidArgumentException;
Expand Down
2 changes: 2 additions & 0 deletions includes/Exception/Invalid_Feature_Metadata_Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @package WordPress\AI\Exception
*/

declare( strict_types=1 );

namespace WordPress\AI\Exception;

use InvalidArgumentException;
Expand Down
8 changes: 5 additions & 3 deletions includes/Feature_Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @package WordPress\AI
*/

declare( strict_types=1 );

namespace WordPress\AI;

use Throwable;
Expand All @@ -20,22 +22,22 @@
*
* @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.
*
* @since 0.1.0
* @var bool
*/
private $initialized = false;
private bool $initialized = false;

/**
* Constructor.
Expand Down
6 changes: 4 additions & 2 deletions includes/Feature_Registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @package WordPress\AI
*/

declare( strict_types=1 );

namespace WordPress\AI;

use WordPress\AI\Contracts\Feature;
Expand All @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions includes/Features/Example_Feature/Example_Feature.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @package WordPress\AI
*/

declare( strict_types=1 );

namespace WordPress\AI\Features\Example_Feature;

use WordPress\AI\Abstracts\Abstract_Feature;
Expand All @@ -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(
Expand All @@ -31,7 +31,7 @@ protected function load_feature_metadata(): array {
}

/**
* Registers the feature hooks.
* {@inheritDoc}
*
* @since 0.1.0
*/
Expand Down
2 changes: 2 additions & 0 deletions includes/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* @package WordPress\AI
*/

declare( strict_types=1 );

namespace WordPress\AI;

// Exit if accessed directly.
Expand Down
Loading