From 20894c1cf89143be1df6fb860787b3955135a0c6 Mon Sep 17 00:00:00 2001 From: Tim Kelty Date: Thu, 1 Feb 2024 20:47:44 -0500 Subject: [PATCH 1/2] Fix dispatcher typing --- src/base/ApplicationTrait.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/base/ApplicationTrait.php b/src/base/ApplicationTrait.php index 72123036480..9d6776002a9 100644 --- a/src/base/ApplicationTrait.php +++ b/src/base/ApplicationTrait.php @@ -45,6 +45,7 @@ use craft\i18n\Formatter; use craft\i18n\I18N; use craft\i18n\Locale; +use craft\log\Dispatcher; use craft\mail\Mailer; use craft\markdown\GithubMarkdown; use craft\markdown\Markdown; @@ -1268,6 +1269,14 @@ public function getLocale(): Locale return $this->get('locale'); } + /** + * Returns the log dispatcher component. + */ + public function getLog(): Dispatcher + { + return $this->get('log'); + } + /** * Returns the current mailer. * From 530e3cf4b9af8ef64570c855963504b80d5a7472 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Fri, 2 Feb 2024 18:36:21 -0800 Subject: [PATCH 2/2] Just use a `@method` --- src/base/ApplicationTrait.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/base/ApplicationTrait.php b/src/base/ApplicationTrait.php index 9d6776002a9..c9b700eba13 100644 --- a/src/base/ApplicationTrait.php +++ b/src/base/ApplicationTrait.php @@ -200,6 +200,7 @@ * @property-read string $installedSchemaVersion The installed schema version * @method AssetManager getAssetManager() Returns the asset manager component. * @method Connection getDb() Returns the database connection component. + * @method Dispatcher getLog() Returns the log dispatcher component. * @method Formatter getFormatter() Returns the formatter component. * @method I18N getI18n() Returns the internationalization (i18n) component. * @method Security getSecurity() Returns the security component. @@ -1269,14 +1270,6 @@ public function getLocale(): Locale return $this->get('locale'); } - /** - * Returns the log dispatcher component. - */ - public function getLog(): Dispatcher - { - return $this->get('log'); - } - /** * Returns the current mailer. *