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

Support to Middlewares #6

Closed
fefas opened this issue Apr 19, 2021 · 0 comments · Fixed by #1
Closed

Support to Middlewares #6

fefas opened this issue Apr 19, 2021 · 0 comments · Fixed by #1
Labels
enhancement New feature or request

Comments

@fefas
Copy link
Member

fefas commented Apr 19, 2021

Support to middlewares that can be used not only by Bauhaus but also by users to define common logic to the entrypoints:

class MyCliMiddleware implements CliMiddleware
{
    public function execute(CliInput $input,CliOutput $output, Handler $next): void
    {
        $output->write("foobar");
        $next->execute($input, $output);
    }
}

$settings = CliApplicationSettings::default()
    ->withMiddlewares(
        new MyCliMiddleware(),
        // ...
    );
@fefas fefas mentioned this issue Apr 19, 2021
@fefas fefas added the enhancement New feature or request label Apr 19, 2021
@fefas fefas closed this as completed in #1 Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant