Skip to content

Commit 2b2550a

Browse files
authored
Merge branch 'master' into patch-2
2 parents ce60841 + a41fef6 commit 2b2550a

File tree

7 files changed

+62
-81
lines changed

7 files changed

+62
-81
lines changed

.travis.yml

Lines changed: 13 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,15 @@
11
language: php
22

3-
sudo: false
4-
5-
cache:
6-
directories:
7-
- ~/.composer/cache/files
8-
9-
matrix:
10-
fast_finish: true
11-
include:
12-
- php: hhvm-stable
13-
sudo: required
14-
dist: trusty
15-
group: edge
16-
- php: 5.3
17-
env: COMPOSER_FLAGS="--prefer-lowest"
18-
- php: 5.4
19-
- php: 5.5
20-
- php: 5.6
21-
env: SYMFONY_VERSION=2.3.*
22-
- php: 5.6
23-
env: SYMFONY_VERSION=2.7.*
24-
- php: 5.6
25-
env: SYMFONY_VERSION=2.8.*
26-
- php: 7.0
27-
env: SYMFONY_VERSION=3.0.*
28-
- php: 7.0
29-
env: SYMFONY_VERSION=3.1.*
30-
- php: 7.1
31-
32-
before_install:
33-
- if [[ "$TRAVIS_PHP_VERSION" != "hhvm-stable" ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi;
34-
35-
before_script:
36-
- composer self-update
37-
- if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --dev --no-update; fi;
38-
- if [ "$COMPOSER_FLAGS" != "" ]; then composer update --prefer-dist --no-interaction --no-scripts $COMPOSER_FLAGS; fi;
39-
- composer install --prefer-dist --no-interaction --no-scripts
40-
41-
script: vendor/bin/phpunit
3+
php:
4+
- 5.5
5+
- 5.6
6+
- 7.0
7+
- 7.1
8+
- 7.2
9+
- hhvm
10+
11+
install:
12+
- composer install
13+
14+
script:
15+
- vendor/bin/phpunit

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
],
1818

1919
"require": {
20-
"php": "^5.3.2 || ^7.0",
21-
"symfony/http-foundation": "^2.3 || ^3.0"
20+
"php": "^5.5.9|>=7.0.8",
21+
"symfony/http-foundation": "~3.0|~4.0"
2222
},
2323
"require-dev": {
2424
"phpunit/phpunit": "^4.8 || ^5.0"

lib/OAuth2.php

Lines changed: 38 additions & 36 deletions
Large diffs are not rendered by default.

lib/OAuth2RedirectException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace OAuth2;
44

5+
use Symfony\Component\HttpFoundation\Response;
6+
57
/**
68
* Redirect the end-user's user agent with error message.
79
*
@@ -37,7 +39,7 @@ class OAuth2RedirectException extends OAuth2ServerException
3739
*/
3840
public function __construct($redirectUri, $error, $errorDescription = null, $state = null, $method = OAuth2::TRANSPORT_QUERY)
3941
{
40-
parent::__construct(OAuth2::HTTP_FOUND, $error, $errorDescription);
42+
parent::__construct(Response::HTTP_FOUND, $error, $errorDescription);
4143

4244
$this->method = $method;
4345
$this->redirectUri = $redirectUri;

tests/Fixtures/OAuth2GrantExtensionJwtBearer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use OAuth2\OAuth2ServerException;
88
use OAuth2\Model\IOAuth2Client;
99
use OAuth2\Tests\Fixtures\OAuth2StorageStub;
10+
use Symfony\Component\HttpFoundation\Response;
1011

1112
class OAuth2GrantExtensionJwtBearer extends OAuth2StorageStub implements IOAuth2GrantExtension
1213
{
@@ -15,7 +16,7 @@ class OAuth2GrantExtensionJwtBearer extends OAuth2StorageStub implements IOAuth2
1516
public function checkGrantExtension(IOAuth2Client $client, $uri, array $inputData, array $authHeaders)
1617
{
1718
if ('urn:ietf:params:oauth:grant-type:jwt-bearer' !== $uri) {
18-
throw new OAuth2ServerException(OAuth2::HTTP_BAD_REQUEST, OAuth2::ERROR_UNSUPPORTED_GRANT_TYPE);
19+
throw new OAuth2ServerException(Response::HTTP_BAD_REQUEST, OAuth2::ERROR_UNSUPPORTED_GRANT_TYPE);
1920
}
2021

2122
if (!isset($inputData['jwt'])) {

tests/Fixtures/OAuth2GrantExtensionLifetimeStub.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use OAuth2\IOAuth2GrantExtension;
77
use OAuth2\OAuth2ServerException;
88
use OAuth2\Model\IOAuth2Client;
9+
use Symfony\Component\HttpFoundation\Response;
910

1011
class OAuth2GrantExtensionLifetimeStub extends OAuth2StorageStub implements IOAuth2GrantExtension
1112
{
@@ -14,7 +15,7 @@ class OAuth2GrantExtensionLifetimeStub extends OAuth2StorageStub implements IOAu
1415
public function checkGrantExtension(IOAuth2Client $client, $uri, array $inputData, array $authHeaders)
1516
{
1617
if ('http://company.com/fb_access_token_time_limited' !== $uri) {
17-
throw new OAuth2ServerException(OAuth2::HTTP_BAD_REQUEST, OAuth2::ERROR_UNSUPPORTED_GRANT_TYPE);
18+
throw new OAuth2ServerException(Response::HTTP_BAD_REQUEST, OAuth2::ERROR_UNSUPPORTED_GRANT_TYPE);
1819
}
1920

2021
if (!isset($inputData['fb_access_token'])) {

tests/Fixtures/OAuth2GrantExtensionStub.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use OAuth2\OAuth2ServerException;
88
use OAuth2\Model\IOAuth2Client;
99
use OAuth2\Tests\Fixtures\OAuth2StorageStub;
10+
use Symfony\Component\HttpFoundation\Response;
1011

1112
class OAuth2GrantExtensionStub extends OAuth2StorageStub implements IOAuth2GrantExtension
1213
{
@@ -15,7 +16,7 @@ class OAuth2GrantExtensionStub extends OAuth2StorageStub implements IOAuth2Grant
1516
public function checkGrantExtension(IOAuth2Client $client, $uri, array $inputData, array $authHeaders)
1617
{
1718
if ('http://company.com/fb_access_token' !== $uri) {
18-
throw new OAuth2ServerException(OAuth2::HTTP_BAD_REQUEST, OAuth2::ERROR_UNSUPPORTED_GRANT_TYPE);
19+
throw new OAuth2ServerException(Response::HTTP_BAD_REQUEST, OAuth2::ERROR_UNSUPPORTED_GRANT_TYPE);
1920
}
2021

2122
if (!isset($inputData['fb_access_token'])) {

0 commit comments

Comments
 (0)