diff --git a/doc/going-further/extending-castor/events.md b/doc/going-further/extending-castor/events.md index 7a216e73..65679837 100644 --- a/doc/going-further/extending-castor/events.md +++ b/doc/going-further/extending-castor/events.md @@ -30,10 +30,6 @@ function my_event_listener(AfterApplicationInitializationEvent|AfterExecuteTaskE Here is the built-in events triggered by Castor: -* `Castor\Event\BeforeApplicationInitializationEvent`: This event is triggered - before the application has been initialized and before the task and context - has been looked at. It provides access to the `Application` instance; - * `Castor\Event\AfterApplicationInitializationEvent`: This event is triggered after the application has been initialized. It provides access to the `Application` instance and an array of `TaskDescriptor` objects; diff --git a/src/Console/Application.php b/src/Console/Application.php index aecb7366..2637ca12 100644 --- a/src/Console/Application.php +++ b/src/Console/Application.php @@ -15,7 +15,6 @@ use Castor\Descriptor\TaskDescriptor; use Castor\Descriptor\TaskDescriptorCollection; use Castor\Event\AfterApplicationInitializationEvent; -use Castor\Event\BeforeApplicationInitializationEvent; use Castor\EventDispatcher; use Castor\ExpressionLanguage; use Castor\Fingerprint\FingerprintHelper; @@ -134,9 +133,6 @@ public function doRun(InputInterface $input, OutputInterface $output): int $this->symfonyStyle = new SymfonyStyle($input, $output); $this->logger->pushHandler(new ConsoleHandler($output)); - $event = new BeforeApplicationInitializationEvent($this); - $this->eventDispatcher->dispatch($event); - $descriptors = $this->initializeApplication($input); // Must be done after the initializeApplication() call, to ensure all diff --git a/src/Event/BeforeApplicationInitializationEvent.php b/src/Event/BeforeApplicationInitializationEvent.php deleted file mode 100644 index 3bedb62b..00000000 --- a/src/Event/BeforeApplicationInitializationEvent.php +++ /dev/null @@ -1,13 +0,0 @@ -setAccessible(true); $r->setValue($exception, $lastFrame[$key]); } diff --git a/tests/Helper/OutputCleaner.php b/tests/Helper/OutputCleaner.php index 1ea420b2..725ff4d0 100644 --- a/tests/Helper/OutputCleaner.php +++ b/tests/Helper/OutputCleaner.php @@ -18,7 +18,7 @@ public static function cleanOutput(string $string): string $string = preg_replace('{^\d\d:\d\d:\d\d }m', 'hh:mm:ss ', $string); // Clean the warning on tasks when remote imports are disabled - $string = preg_replace('{\d{2}:\d{2}:\d{2} WARNING \[castor\] Could not import "[\w:/\.-]*" in "[\w:/\.-]*" on line \d+. Reason: Remote imports are disabled\.}m', '', $string); + $string = preg_replace('{hh:mm:ss WARNING \[castor\] Could not import "[\w:/\.-]*" in "[\w:/\.-]*" on line \d+. Reason: Remote imports are disabled\.}m', '', $string); // Avoid spacing issues $string = ltrim($string, "\n"); // Trim output start to avoid empty lines