Skip to content

Commit

Permalink
Improve recipe page documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette committed Nov 17, 2023
1 parent 0fc7c07 commit 1808c87
Showing 1 changed file with 43 additions and 15 deletions.
58 changes: 43 additions & 15 deletions app/src/MyApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,48 @@
use UserFrosting\Sprinkle\SprinkleRecipe;
use UserFrosting\Theme\AdminLTE\AdminLTE;

/**
* The Sprinkle Recipe
*
* @see https://learn.userfrosting.com/sprinkles/recipe
*/
class MyApp implements
SprinkleRecipe,
BakeryRecipe
{
/**
* {@inheritdoc}
* Return the Sprinkle name.
*
* @see https://learn.userfrosting.com/sprinkles/recipe#name
*
* @return string
*/
public function getName(): string
{
return 'My Application';
}

/**
* {@inheritdoc}
* Return the Sprinkle dir path.
*
* @see https://learn.userfrosting.com/sprinkles/recipe#path
*
* @return string
*/
public function getPath(): string
{
return __DIR__ . '/../';
}

/**
* {@inheritdoc}
*/
public function getBakeryCommands(): array
{
return [
HelloCommand::class,
];
}

/**
* {@inheritdoc}
* Return dependent sprinkles.
*
* First one will be loaded first, with this sprinkle being last.
* Dependent sprinkle dependencies will also be loaded recursively.
*
* @see https://learn.userfrosting.com/sprinkles/recipe#dependent-sprinkles
*
* @return string[]|SprinkleRecipe[]
*/
public function getSprinkles(): array
{
Expand All @@ -64,6 +74,8 @@ public function getSprinkles(): array
/**
* Returns a list of routes definition in PHP files.
*
* @see https://learn.userfrosting.com/sprinkles/recipe#routes
*
* @return string[]
*/
public function getRoutes(): array
Expand All @@ -74,14 +86,30 @@ 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[]
* @see https://learn.userfrosting.com/sprinkles/recipe#services
*
* @return string[]|\UserFrosting\ServicesProvider\ServicesProviderInterface[]
*/
public function getServices(): array
{
return [
MyServices::class,
];
}

/**
* Return an array of all registered Bakery Commands.
*
* @see https://learn.userfrosting.com/sprinkles/recipe#bakeryrecipe
*
* @return string[]
*/
public function getBakeryCommands(): array
{
return [
HelloCommand::class,
];
}
}

0 comments on commit 1808c87

Please sign in to comment.