From 0fbf8256daf48a86d9a81588951677a3176bb0fb Mon Sep 17 00:00:00 2001 From: Louis Charette Date: Sat, 20 Jan 2024 22:20:53 -0500 Subject: [PATCH] Use proper `class-string`, inheritance, and standardize phpdoc inheritance --- app/src/Core.php | 27 ++++++++++++++----- app/src/Sprinkle/Recipe/MigrationRecipe.php | 2 +- app/src/Sprinkle/Recipe/SeedRecipe.php | 2 +- .../Sprinkle/Recipe/TwigExtensionRecipe.php | 2 +- 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/app/src/Core.php b/app/src/Core.php index b840e50e..3431f861 100644 --- a/app/src/Core.php +++ b/app/src/Core.php @@ -97,6 +97,8 @@ class Core implements BakeryRecipe { /** + * Return the Sprinkle name. + * * {@inheritdoc} */ public function getName(): string @@ -105,6 +107,8 @@ public function getName(): string } /** + * Return the Sprinkle dir path. + * * {@inheritdoc} */ public function getPath(): string @@ -113,6 +117,8 @@ public function getPath(): string } /** + * Return an array of all registered Bakery Commands. + * * {@inheritdoc} * * @codeCoverageIgnore @@ -153,6 +159,8 @@ public function getBakeryCommands(): array } /** + * Return dependent sprinkles. + * * {@inheritdoc} */ public function getSprinkles(): array @@ -163,7 +171,7 @@ public function getSprinkles(): array /** * Returns a list of routes definition in PHP files. * - * @return string[] + * {@inheritDoc} */ public function getRoutes(): array { @@ -173,9 +181,9 @@ public function getRoutes(): array } /** - * Returns a list of all PHP-DI services/container definitions files. + * Returns a list of all PHP-DI services/container definitions class. * - * @return string[] + * {@inheritDoc} */ public function getServices(): array { @@ -203,7 +211,7 @@ public function getServices(): array /** * Returns a list of all Middlewares classes. * - * @return \Psr\Http\Server\MiddlewareInterface[] + * {@inheritDoc} */ public function getMiddlewares(): array { @@ -220,7 +228,7 @@ public function getMiddlewares(): array /** * Return an array of all registered Twig Extensions. * - * @return \Twig\Extension\ExtensionInterface[] + * {@inheritDoc} */ public function getTwigExtensions(): array { @@ -235,6 +243,11 @@ public function getTwigExtensions(): array ]; } + /** + * Return an array of all registered Migrations. + * + * {@inheritDoc} + */ public function getMigrations(): array { return [ @@ -244,7 +257,9 @@ public function getMigrations(): array } /** - * {@inheritDoc} + * Return a map of all registered event listener. + * + * {@inheritdoc} */ public function getEventListeners(): array { diff --git a/app/src/Sprinkle/Recipe/MigrationRecipe.php b/app/src/Sprinkle/Recipe/MigrationRecipe.php index 5180e8ec..3aa3ac87 100644 --- a/app/src/Sprinkle/Recipe/MigrationRecipe.php +++ b/app/src/Sprinkle/Recipe/MigrationRecipe.php @@ -20,7 +20,7 @@ interface MigrationRecipe /** * Return an array of all registered Migrations. * - * @return string[] + * @return class-string<\UserFrosting\Sprinkle\Core\Database\MigrationInterface>[] */ public function getMigrations(): array; } diff --git a/app/src/Sprinkle/Recipe/SeedRecipe.php b/app/src/Sprinkle/Recipe/SeedRecipe.php index f5021fd0..043a6847 100644 --- a/app/src/Sprinkle/Recipe/SeedRecipe.php +++ b/app/src/Sprinkle/Recipe/SeedRecipe.php @@ -20,7 +20,7 @@ interface SeedRecipe /** * Return an array of all registered seeds. * - * @return string[] + * @return class-string<\UserFrosting\Sprinkle\Core\Seeder\SeedInterface>[] */ public function getSeeds(): array; } diff --git a/app/src/Sprinkle/Recipe/TwigExtensionRecipe.php b/app/src/Sprinkle/Recipe/TwigExtensionRecipe.php index 47182a1c..d1052a5e 100644 --- a/app/src/Sprinkle/Recipe/TwigExtensionRecipe.php +++ b/app/src/Sprinkle/Recipe/TwigExtensionRecipe.php @@ -20,7 +20,7 @@ interface TwigExtensionRecipe /** * Return an array of all registered Twig Extensions. * - * @return string[] + * @return class-string<\Twig\Extension\ExtensionInterface>[] */ public function getTwigExtensions(): array; }