diff --git a/CHANGELOG.md b/CHANGELOG.md index 37c01190..167db939 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ ## Not released yet +## 0.17.0 (2024-05-27) + +### Features + +* Add `Castor\Event\AfterBootEvent` to perform action when the application is ready +* Add `Symfony\Component\Finder\SplFileInfo` to the stubs + +### Fixes + +* Map console verbosity level to default context, even when no context is defined + ## 0.16.0 (2024-05-22) ### Features diff --git a/doc/going-further/extending-castor/events.md b/doc/going-further/extending-castor/events.md index cffae11c..8372d79a 100644 --- a/doc/going-further/extending-castor/events.md +++ b/doc/going-further/extending-castor/events.md @@ -37,6 +37,9 @@ Here is the built-in events triggered by Castor: functions has been resolved. It provides access to an array of `TaskDescriptor` and `SymfonyTaskDescriptor` objects; +* `Castor\Event\AfterBootEvent`: This event is triggered when the application is + ready to execute task + * `Castor\Event\BeforeExecuteTaskEvent`: This event is triggered before executing a task. It provides access to the `TaskCommand` instance; diff --git a/src/Console/Application.php b/src/Console/Application.php index 0d7b80e1..fea610ac 100644 --- a/src/Console/Application.php +++ b/src/Console/Application.php @@ -18,7 +18,7 @@ class Application extends SymfonyApplication { public const NAME = 'castor'; - public const VERSION = 'v0.16.0'; + public const VERSION = 'v0.17.0'; private Command $command; diff --git a/src/Event/AfterBootEvent.php b/src/Event/AfterBootEvent.php new file mode 100644 index 00000000..dac63e18 --- /dev/null +++ b/src/Event/AfterBootEvent.php @@ -0,0 +1,14 @@ +load($mount, $currentFunctions, $currentClasses, $input, $output); } + + $this->eventDispatcher->dispatch(new AfterBootEvent($this->application)); } public function addMount(Mount $mount): void