Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add note to remove method hooks in generated template if not needed #1005

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions templates/bake/Plugin/src/Plugin.php.twig
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class {{ name }}Plugin extends BasePlugin
*/
public function bootstrap(PluginApplicationInterface $app): void
{
// remove this method hook if you don't need it
}

/**
Expand All @@ -54,6 +55,7 @@ class {{ name }}Plugin extends BasePlugin
*/
public function routes(RouteBuilder $routes): void
{
// remove this method hook if you don't need it
$routes->plugin(
'{{ plugin }}',
['path' => '/{{ routePath }}'],
Expand All @@ -75,6 +77,7 @@ class {{ name }}Plugin extends BasePlugin
public function middleware(MiddlewareQueue $middlewareQueue): MiddlewareQueue
{
// Add your middlewares here
// remove this method hook if you don't need it

return $middlewareQueue;
}
Expand All @@ -88,6 +91,7 @@ class {{ name }}Plugin extends BasePlugin
public function console(CommandCollection $commands): CommandCollection
{
// Add your commands here
// remove this method hook if you don't need it

$commands = parent::console($commands);

Expand All @@ -104,5 +108,6 @@ class {{ name }}Plugin extends BasePlugin
public function services(ContainerInterface $container): void
{
// Add your services here
// remove this method hook if you don't need it
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class ExamplePlugin extends BasePlugin
*/
public function bootstrap(PluginApplicationInterface $app): void
{
// remove this method hook if you don't need it
}

/**
Expand All @@ -39,6 +40,7 @@ public function bootstrap(PluginApplicationInterface $app): void
*/
public function routes(RouteBuilder $routes): void
{
// remove this method hook if you don't need it
$routes->plugin(
'Company/Example',
['path' => '/company/example'],
Expand All @@ -60,6 +62,7 @@ function (RouteBuilder $builder) {
public function middleware(MiddlewareQueue $middlewareQueue): MiddlewareQueue
{
// Add your middlewares here
// remove this method hook if you don't need it

return $middlewareQueue;
}
Expand All @@ -73,6 +76,7 @@ public function middleware(MiddlewareQueue $middlewareQueue): MiddlewareQueue
public function console(CommandCollection $commands): CommandCollection
{
// Add your commands here
// remove this method hook if you don't need it

$commands = parent::console($commands);

Expand All @@ -89,5 +93,6 @@ public function console(CommandCollection $commands): CommandCollection
public function services(ContainerInterface $container): void
{
// Add your services here
// remove this method hook if you don't need it
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class SimpleExamplePlugin extends BasePlugin
*/
public function bootstrap(PluginApplicationInterface $app): void
{
// remove this method hook if you don't need it
}

/**
Expand All @@ -39,6 +40,7 @@ public function bootstrap(PluginApplicationInterface $app): void
*/
public function routes(RouteBuilder $routes): void
{
// remove this method hook if you don't need it
$routes->plugin(
'SimpleExample',
['path' => '/simple-example'],
Expand All @@ -60,6 +62,7 @@ function (RouteBuilder $builder) {
public function middleware(MiddlewareQueue $middlewareQueue): MiddlewareQueue
{
// Add your middlewares here
// remove this method hook if you don't need it

return $middlewareQueue;
}
Expand All @@ -73,6 +76,7 @@ public function middleware(MiddlewareQueue $middlewareQueue): MiddlewareQueue
public function console(CommandCollection $commands): CommandCollection
{
// Add your commands here
// remove this method hook if you don't need it

$commands = parent::console($commands);

Expand All @@ -89,5 +93,6 @@ public function console(CommandCollection $commands): CommandCollection
public function services(ContainerInterface $container): void
{
// Add your services here
// remove this method hook if you don't need it
}
}