Permalink
Browse files

some cleanup to go along with changes in lithium next branch

  • Loading branch information...
1 parent 9659529 commit beb84741d27b115bf284e832d691a501e3928670 @gwoo gwoo committed Jul 17, 2010
Showing with 5 additions and 14 deletions.
  1. +3 −12 extensions/service/Oauth.php
  2. +2 −2 tests/mocks/extensions/service/MockSocket.php
@@ -100,9 +100,7 @@ public function send($method, $path = null, $data = array(), array $options = ar
}
$options['headers'] = array('Authorization' => $header);
}
- $data += $oauth;
-
- $response = parent::send($method, $url, $data, $options);
+ $response = parent::send($method, $url, $data + $oauth, $options);
if (strpos($response, 'oauth_token=') !== false) {
return $this->_decode($response);
@@ -237,15 +235,8 @@ protected function _params($params = array()) {
* @return void
*/
protected function _decode($query = null) {
- $token = array();
- $result = array_filter(explode('&', $query), function ($value) use (&$token) {
- $parts = explode("=", $value);
- if (count($parts) > 1) {
- $token[rawurldecode($parts[0])] = rawurldecode($parts[1]);
- }
- return false;
- });
- return $token;
+ parse_str($query, $data);
+ return $data;
}
}
@@ -58,8 +58,8 @@ public function send($message, array $options = array()) {
if (strpos($message->path, 'search') !== false) {
$body = json_encode(array('test' => 'cool'));
}
- $message = $this->read($body);
- return new $options['classes']['response'](compact('message'));
+ $body = $this->read($body);
+ return new $options['classes']['response'](compact('body'));
}
}

0 comments on commit beb8474

Please sign in to comment.