Skip to content

Commit

Permalink
Merge pull request #61 from stloyd/buzz_update
Browse files Browse the repository at this point in the history
Adjust code to use Buzz 0.7
  • Loading branch information
asm89 committed Jul 3, 2012
2 parents 94df913 + e0ff9a9 commit 8eb0129
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
8 changes: 5 additions & 3 deletions OAuth/ResourceOwner/AbstractResourceOwner.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
namespace HWI\Bundle\OAuthBundle\OAuth\ResourceOwner;

use Buzz\Client\ClientInterface as HttpClientInterface,
Buzz\Message\RequestInterface as HttpRequestInterface,
Buzz\Message\MessageInterface as HttpMessageInterface,
Buzz\Message\Request as HttpRequest,
Buzz\Message\Response as HttpResponse;

Expand Down Expand Up @@ -144,7 +146,7 @@ protected function getUserResponse()
protected function httpRequest($url, $content = null, $headers = array(), $method = null)
{
if (null === $method) {
$method = null === $content ? HttpRequest::METHOD_GET : HttpRequest::METHOD_POST;
$method = null === $content ? HttpRequestInterface::METHOD_GET : HttpRequestInterface::METHOD_POST;
}

$request = new HttpRequest($method, $url);
Expand All @@ -171,11 +173,11 @@ public function addPaths(array $paths)
/**
* Get the 'parsed' content based on the response headers.
*
* @param HttpResponse $rawResponse
* @param HttpMessageInterface $rawResponse
*
* @return mixed
*/
protected function getResponseContent(HttpResponse $rawResponse)
protected function getResponseContent(HttpMessageInterface $rawResponse)
{
if (false !== strpos($rawResponse->getHeader('Content-Type'), 'application/json')) {
$response = json_decode($rawResponse->getContent(), true);
Expand Down
4 changes: 1 addition & 3 deletions OAuth/ResourceOwner/GenericOAuth1ResourceOwner.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@

namespace HWI\Bundle\OAuthBundle\OAuth\ResourceOwner;

use Buzz\Client\ClientInterface as HttpClientInterface,
Buzz\Message\Request as HttpRequest,
Buzz\Message\Response as HttpResponse;
use Buzz\Client\ClientInterface as HttpClientInterface;

use Symfony\Component\Security\Core\Exception\AuthenticationException,
Symfony\Component\Security\Http\HttpUtils,
Expand Down
4 changes: 1 addition & 3 deletions OAuth/ResourceOwner/GenericOAuth2ResourceOwner.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@

namespace HWI\Bundle\OAuthBundle\OAuth\ResourceOwner;

use Buzz\Client\ClientInterface as HttpClientInterface,
Buzz\Message\Request as HttpRequest,
Buzz\Message\Response as HttpResponse;
use Buzz\Client\ClientInterface as HttpClientInterface;

use Symfony\Component\Security\Core\Exception\AuthenticationException,
Symfony\Component\Security\Http\HttpUtils,
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"php": ">=5.3.2",
"symfony/framework-bundle": ">=2.0,<2.2-dev",
"symfony/security-bundle": ">=2.0,<2.2-dev",
"kriswallsmith/buzz": "0.6"
"kriswallsmith/buzz": "0.7"
},

"require-dev": {
Expand Down

0 comments on commit 8eb0129

Please sign in to comment.