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

EZP-21129: Get rid of RMF\Request #442

Merged
merged 25 commits into from Jul 5, 2013
Merged

Conversation

bdunogier
Copy link
Member

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

  • Check last remains of RMF\Request

*/
private $router;

private $restRoutesPrefix;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc please :)

@bdunogier
Copy link
Member Author

Okay, tests pass. The review is really open now :-)

$url = $this->restRoutesPrefix . $url;
}

// we create a request with a new context
Copy link
Contributor

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 ;)

@andrerom
Copy link
Contributor

andrerom commented Jul 5, 2013

+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 )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type hint as array ?

@lolautruche
Copy link
Contributor

Beside my remarks, looks good +1.
Good job !

However, ensure that tests pass on Travis 😃

Bertrand Dunogier added 18 commits July 5, 2013 12:00
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)
@bdunogier
Copy link
Member Author

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 ) );
Copy link
Contributor

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.

@pspanja
Copy link
Contributor

pspanja commented Jul 5, 2013

Looks good from my side, +1.

@bdunogier bdunogier merged commit 3489b7b into master Jul 5, 2013
@bdunogier bdunogier deleted the impl-EZP-21129-rest_rmf_request branch July 5, 2013 11:57
@bdunogier
Copy link
Member Author

Merged: fad2be9...3489b7b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants