diff --git a/grumphp.yml b/grumphp.yml index 22d9057..0cda4f7 100644 --- a/grumphp.yml +++ b/grumphp.yml @@ -1,6 +1,4 @@ grumphp: - git_hook_variables: - EXEC_GRUMPHP_COMMAND: 'docker run -e "TERM=xterm-256color" --tty=true --rm -v $PWD:/code:cached pheature/pheature-php-dev:latest' hooks_dir: . hooks_preset: local tasks: diff --git a/src/Write/Feature.php b/src/Write/Feature.php index 2e73fc3..fe6f2e1 100644 --- a/src/Write/Feature.php +++ b/src/Write/Feature.php @@ -13,10 +13,10 @@ final class Feature implements JsonSerializable { private FeatureId $featureId; private bool $enabled; - /** - * @var Strategy[] - */ + /** @var Strategy[] */ private array $strategies = []; + /** @var array */ + private array $events = []; /** * Feature constructor. @@ -34,6 +34,17 @@ public function __construct(FeatureId $featureId, bool $enabled, array $strategi } } + /** + * @return object[] + */ + public function release(): array + { + $events = $this->events; + $this->events = []; + + return $events; + } + public static function withId(FeatureId $featureId): self { return new self($featureId, false);