Skip to content

Commit

Permalink
Fix compatibility with league/oauth2-client and PHP 7.1 (#14)
Browse files Browse the repository at this point in the history
* Fix compatibility with league/oauth2-client and PHP 7.1

* Fix HHVM build on travis
  • Loading branch information
pyrech authored and adam-paterson committed Jun 20, 2017
1 parent f2d5770 commit ccc329e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
language: php

dist: trusty

php:
- 5.6
- 7.0
- 7.1
- hhvm

before_script:
Expand All @@ -16,4 +19,4 @@ script:

after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
}
],
"require": {
"php": ">=5.6.0 <7.1",
"league/oauth2-client": "1.*"
"php": ">=5.6.0",
"league/oauth2-client": "1.*|2.*"
},
"require-dev": {
"mockery/mockery": "~0.9",
Expand Down
7 changes: 6 additions & 1 deletion src/Provider/Slack.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,12 @@ public function fetchAuthorizedUserDetails(AccessToken $token)

$request = $this->getAuthenticatedRequest(self::METHOD_GET, $url, $token);

return $this->getResponse($request);
// Keep compatibility with League\OAuth2\Client v1
if (!method_exists($this, 'getParsedResponse')) {
return $this->getResponse($request);
}

return $this->getParsedResponse($request);
}

/**
Expand Down

0 comments on commit ccc329e

Please sign in to comment.