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
EZP-21129: Get rid of RMF\Request #442
Conversation
*/ | ||
private $router; | ||
|
||
private $restRoutesPrefix; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc please :)
Okay, tests pass. The review is really open now :-) |
$url = $this->restRoutesPrefix . $url; | ||
} | ||
|
||
// we create a request with a new context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline doc is nice, but this only says what it does, not why ;)
+0.8, don't knwo that much about the REST impl. review ping @pspanja @lolautruche |
* @param array $match Match array returned by Router::match() / Router::matchRequest() | ||
* @return bool | ||
*/ | ||
private function matchesRestRequest( $match ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type hint as array ?
Beside my remarks, looks good +1. However, ensure that tests pass on Travis 😃 |
This reverts commit 057b6271705deb6d2d31defd0412460a6138dde8.
The controllers currently have a distinct httpFoundationRequest property so that unreplaced calls still work. Calls to ->variables and some ->request, including path, have been replaced already.
Added a new RequestParser, implemented in EzPublishRestBundle\RequestParser\Router, that has a parseHref method, and replaced in all Input\Parser implementations & tests.
The REST prefix is for now explicitely allowed in payloads, since it was allowed since 5.0. Must be fixed in another story (EZP-21176)
We should be good now, but I'm still short +0.2... |
|
||
if ( !isset( $parsingResult[$attribute] ) ) | ||
{ | ||
throw new InvalidArgumentException( "No such attribute '$attribute' in route matched from $href\n" . print_r( $parsingResult, true ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick as this it seems to be pending for removal, but Exceptions\InvalidArgumentException
should be used.
Looks good from my side, +1. |
Merged: fad2be9...3489b7b. |
Totally removes the requirement on
RMF\Request
. The Symfony Request is used instead, directly in Controllers.The REST Client tests still work because they still use the old
requestParser\eZPublish
with hardcoded routes, but hasn't been refactored here.TODO
RMF\Request