{"action":"created","issue":{"url":"https://api.github.com/repos/sparkphp/spark/issues/50","labels_url":"https://api.github.com/repos/sparkphp/spark/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/sparkphp/spark/issues/50/comments","events_url":"https://api.github.com/repos/sparkphp/spark/issues/50/events","html_url":"https://github.com/sparkphp/spark/pull/50","id":114645911,"number":50,"title":"Modify middleware to implement Relay\\MiddlewareInterface","user":{"login":"elazar","id":15487,"avatar_url":"https://avatars.githubusercontent.com/u/15487?v=3","gravatar_id":"","url":"https://api.github.com/users/elazar","html_url":"https://github.com/elazar","followers_url":"https://api.github.com/users/elazar/followers","following_url":"https://api.github.com/users/elazar/following{/other_user}","gists_url":"https://api.github.com/users/elazar/gists{/gist_id}","starred_url":"https://api.github.com/users/elazar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elazar/subscriptions","organizations_url":"https://api.github.com/users/elazar/orgs","repos_url":"https://api.github.com/users/elazar/repos","events_url":"https://api.github.com/users/elazar/events{/privacy}","received_events_url":"https://api.github.com/users/elazar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-02T17:41:40Z","updated_at":"2015-11-02T20:22:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sparkphp/spark/pulls/50","html_url":"https://github.com/sparkphp/spark/pull/50","diff_url":"https://github.com/sparkphp/spark/pull/50.diff","patch_url":"https://github.com/sparkphp/spark/pull/50.patch"},"body":"This will allow middlewares included in [`DefaultCollection`](https://github.com/sparkphp/spark/blob/master/src/Middleware/DefaultCollection.php) to pass validation checks in [`Collection`](https://github.com/sparkphp/spark/blob/6e4ed04d00c910fa3bbb4a2559d7bc53fe4b43ab/src/Middleware/Collection.php#L26). It also includes a stopgap measure for the Relay [`ResponseSender`](https://github.com/relayphp/Relay.Middleware/blob/1.x/src/ResponseSender.php) middleware not implementing [`MiddlewareInterface`](https://github.com/relayphp/Relay.Relay/blob/1.x/src/MiddlewareInterface.php); see also relayphp/Relay.Middleware#12.\r\n\r\n`ActionHandler`, `ContentHandler`, and `RouteHandler` all actually need an instance of `ServerRequestInterface` versus just `RequestInterface`, but making them type hint against the former precludes implementing `MiddlewareInterface`. Maybe we should just include a more specific type check in their `__invoke()` implementations? Or change the validation checks in `Collection`?"},"comment":{"url":"https://api.github.com/repos/sparkphp/spark/issues/comments/153145868","html_url":"https://github.com/sparkphp/spark/pull/50#issuecomment-153145868","issue_url":"https://api.github.com/repos/sparkphp/spark/issues/50","id":153145868,"user":{"login":"shadowhand","id":38203,"avatar_url":"https://avatars.githubusercontent.com/u/38203?v=3","gravatar_id":"","url":"https://api.github.com/users/shadowhand","html_url":"https://github.com/shadowhand","followers_url":"https://api.github.com/users/shadowhand/followers","following_url":"https://api.github.com/users/shadowhand/following{/other_user}","gists_url":"https://api.github.com/users/shadowhand/gists{/gist_id}","starred_url":"https://api.github.com/users/shadowhand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shadowhand/subscriptions","organizations_url":"https://api.github.com/users/shadowhand/orgs","repos_url":"https://api.github.com/users/shadowhand/repos","events_url":"https://api.github.com/users/shadowhand/events{/privacy}","received_events_url":"https://api.github.com/users/shadowhand/received_events","type":"User","site_admin":false},"created_at":"2015-11-02T20:22:16Z","updated_at":"2015-11-02T20:22:16Z","body":"I'm fine with using Relay's `MiddlewareInterface` but we have to be fully compatible with it (handling `null` `$next` values) if we are going to use it."}}