Last active
August 29, 2015 14:11
-
-
Save koriym/6cdb82fe5ebf8fe219bd to your computer and use it in GitHub Desktop.
Syntax suger of get request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param string|Uri $uri | |
* @param array $query | |
* | |
* @return callable | |
*/ | |
function resource($uri, array $query) | |
{ | |
$resource = (new Injector(new AppModule, __DIR__ . '/tmp'))->getInstance(ResourceInterface::class); | |
$request = $resource->get->uri($uri)->withQuery($query)->eager->request(); | |
return $request; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment