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

Update route callable signature for PSR-15 #2052

Closed
codeguy opened this issue Nov 19, 2016 · 6 comments
Closed

Update route callable signature for PSR-15 #2052

codeguy opened this issue Nov 19, 2016 · 6 comments

Comments

@codeguy
Copy link
Member

codeguy commented Nov 19, 2016

Related to #2050

@codeguy codeguy added the Slim 4 label Nov 19, 2016
@codeguy codeguy added this to the 4.0 milestone Nov 19, 2016
@codeguy
Copy link
Member Author

codeguy commented Nov 19, 2016

Will become:

$app->get('/foo', function (ServerRequest $request, array $args) {
    // Return response object
});

@geekish
Copy link
Contributor

geekish commented Nov 19, 2016

If you're going to continue using the array $args by default I'd recommend not adding them as request attributes. See #2019

@akrabat
Copy link
Member

akrabat commented Nov 19, 2016

If you're going to continue using the array $args by default I'd recommend not adding them as request attributes. See #2019

We should look at that, certainly.

The route callable's signature is configuration via a strategy, so this ticket is for creating the new strategy to more closely match the PSR-15 signature.

@geggleto geggleto modified the milestone: 4.0 Mar 19, 2017
@odan
Copy link
Contributor

odan commented Feb 14, 2018

Hi!

According to the accepted PSR-15 specification the new signature should look like this.

$app->get('/foo', function (ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface {
    $response = $handler->handle($request);

    // Do something...

    // Return response object
    return $response;
});

Is this correct? Will the signature in Slim version 4 look like this?

@akrabat
Copy link
Member

akrabat commented Feb 14, 2018

@odan Yes - see #2379

@akrabat
Copy link
Member

akrabat commented Nov 25, 2018

Fixed in #2497

@akrabat akrabat closed this as completed Nov 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants