Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
request processing system
Priority:
Major
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
30 May 2015 at 21:04 UTC
Updated:
21 Aug 2015 at 17:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
marvin_b8 commentedI'm not sure if this the best solution.
Comment #2
Crell commentedHm, no, we would be modifying the ControllerResolver's getArguments() logic. I'd have to double check which classes that is right now as they've been refactored several times. :-) A ParamConverter is not the right place for this.
Comment #3
cilefen commented@Crell If I understand the situation we would have to not type hint the request in function signatures in ControllerResolver but then check the request type in the function logic.
Comment #4
marvin_b8 commentedMore like this ?
Comment #6
Crell commented#4 is more in the right direction, yes.
Comment #7
dawehnerLet's expand our unit test here :)
Comment #8
Crell commentedThe blocking issue is in, so this can move forward.
Comment #9
cilefen commentedComment #10
cilefen commentedThe problem here is that a Symfony Request is the wrong parameter type. We need a request of type Psr\Http\Message\ServerRequestInterface.
Comment #11
dawehnerI don't get it at all ... the point is to be able to pass along the server request to the controller, we don't need to convert anything.
Comment #12
marvin_b8 commentedNow with the right injecten and some unit tests.
Comment #13
dawehnerOH I take back #11, that was BS.
That change is wrong. The result of a controller should not be created in the controller resolver.
I'd suggest you to not try to fix all those small things please. Please try to keep in mind that you should optimize for reviewability.
Comment #14
marvin_b8 commentedSo =)
Comment #15
marvin_b8 commentedComment #16
dawehnerThank you!
Comment #17
dawehnerJust a random nitpick :P
We don't use a semicolon at the end here
Comment #18
Crell commentedI think all my comments on the latest patch are nits, so next patch is probably RTBC. Thanks, marvin!
Because we have PHP 5.5 now, we can use ServerRequestInterface::class, with a use statement in the file header. That's easier to read and easier to write. :-)
As above, we can use ::class now.
We don't technically support string returns from controllers at this point, so our test controllers shouldn't return them. I'd suggest just:
Needs a linebreak between these two lines.
Comment #19
cilefen commentedComment #20
Crell commentedGo team!
Comment #21
dawehnerYeah!
Comment #22
alexpottNeed to document the new parameter and I think the new capability should be listed on the ControllerResolver as this is another added behaviour.
Comment #23
joshi.rohit100Comment #24
Crell commentedAlex: Can you clarify what you mean by "new capability should be listed on the ControllerResolver"? You mean in Drupal\ControllerResolver's docblock?
Comment #25
alexpott@Crell I think we should document PSR-7 support in menu.api.php
Comment #26
Crell commentedTurns out menu.api.php didn't document ANY of the non-placeholder parameters that are supported. So I added a block that notes all three.
I also switched the RouteMatchInterface line to use PHP 5.5 syntax for consistency (it was bugging me), and cleaned up the use statements in the file, because I was there.
Comment #27
Crell commentedCrell-- for stupid editing mistakes.
Comment #28
dawehnerI really like the documentation. Its helpful. I was wondering whether we should rearrange things a bit.
Comment #29
alexpottThanks for improving the documentation. Committed c176ab7 and pushed to 8.0.x. Thanks!
Thanks for adding the beta evaluation to the issue summary.
Comment #31
Crell commentedThanks, Alex! Related doc follow-up: #2547707: Split routing documentation out of menu.api.php