Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

Commit

Permalink
Using stubs and reusing request body (#5)
Browse files Browse the repository at this point in the history
* Added stubs for IDE completion
* Reuse request body rather than create a new one
  • Loading branch information
pachico authored Feb 14, 2018
1 parent 0e69428 commit b137ba0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
}
],
"require": {
"php" : "^7.0"
"php": "^7.0"
},
"require-dev": {
"slim/slim": "^3.9",
"eaglewu/swoole-ide-helper": "dev-master",
"phpunit/phpunit": "6.5.6",
"slim/slim": "^3.9",
"squizlabs/php_codesniffer": "^3.2"
},
"autoload": {
Expand All @@ -46,5 +47,6 @@
},
"config": {
"sort-packages": true
}
},
"minimum-stability": "stable"
}
2 changes: 1 addition & 1 deletion src/Bridge/RequestTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private function copyBody(swoole_http_request $request, Http\Request $slimReques
return $slimRequest;
}

$body = new Http\Body(fopen('php://temp', 'w'));
$body = $slimRequest->getBody();
$body->write($request->rawContent());
$body->rewind();

Expand Down

0 comments on commit b137ba0

Please sign in to comment.