From a1ff31261b51bdde88f717d035675320a9344105 Mon Sep 17 00:00:00 2001 From: Spomky Date: Fri, 31 Oct 2014 16:11:09 +0100 Subject: [PATCH] PSR-0 to PSR-4 Autoloading * PSR-0 => PSR-4 * PHP 5.6 tests added * PHPUnit 4.x used instead of the version used by Travis-CI * HHVM test badge added --- .travis.yml | 8 ++++---- README.md | 3 ++- composer.json | 8 +++++++- lib/{OAuth2 => }/IOAuth2GrantClient.php | 0 lib/{OAuth2 => }/IOAuth2GrantCode.php | 0 lib/{OAuth2 => }/IOAuth2GrantExtension.php | 0 lib/{OAuth2 => }/IOAuth2GrantImplicit.php | 0 lib/{OAuth2 => }/IOAuth2GrantUser.php | 0 lib/{OAuth2 => }/IOAuth2RefreshTokens.php | 0 lib/{OAuth2 => }/IOAuth2Storage.php | 0 lib/{OAuth2 => }/Model/IOAuth2AccessToken.php | 0 lib/{OAuth2 => }/Model/IOAuth2AuthCode.php | 0 lib/{OAuth2 => }/Model/IOAuth2Client.php | 0 lib/{OAuth2 => }/Model/IOAuth2RefreshToken.php | 0 lib/{OAuth2 => }/Model/IOAuth2Token.php | 0 lib/{OAuth2 => }/Model/OAuth2AccessToken.php | 0 lib/{OAuth2 => }/Model/OAuth2AuthCode.php | 0 lib/{OAuth2 => }/Model/OAuth2Client.php | 0 lib/{OAuth2 => }/Model/OAuth2RefreshToken.php | 0 lib/{OAuth2 => }/Model/OAuth2Token.php | 0 lib/{OAuth2 => }/OAuth2.php | 0 lib/{OAuth2 => }/OAuth2AuthenticateException.php | 0 lib/{OAuth2 => }/OAuth2Client.php | 0 lib/{OAuth2 => }/OAuth2Exception.php | 0 lib/{OAuth2 => }/OAuth2RedirectException.php | 0 lib/{OAuth2 => }/OAuth2ServerException.php | 0 tests/{OAuth2/Tests => }/Fixtures/OAuth2GrantCodeStub.php | 0 .../Fixtures/OAuth2GrantExtensionLifetimeStub.php | 0 .../Tests => }/Fixtures/OAuth2GrantExtensionStub.php | 0 tests/{OAuth2/Tests => }/Fixtures/OAuth2GrantUserStub.php | 0 tests/{OAuth2/Tests => }/Fixtures/OAuth2StorageStub.php | 0 tests/{OAuth2/Tests => }/Model/OAuth2TokenTest.php | 0 tests/bootstrap.php | 1 - 33 files changed, 13 insertions(+), 7 deletions(-) rename lib/{OAuth2 => }/IOAuth2GrantClient.php (100%) rename lib/{OAuth2 => }/IOAuth2GrantCode.php (100%) rename lib/{OAuth2 => }/IOAuth2GrantExtension.php (100%) rename lib/{OAuth2 => }/IOAuth2GrantImplicit.php (100%) rename lib/{OAuth2 => }/IOAuth2GrantUser.php (100%) rename lib/{OAuth2 => }/IOAuth2RefreshTokens.php (100%) rename lib/{OAuth2 => }/IOAuth2Storage.php (100%) rename lib/{OAuth2 => }/Model/IOAuth2AccessToken.php (100%) rename lib/{OAuth2 => }/Model/IOAuth2AuthCode.php (100%) rename lib/{OAuth2 => }/Model/IOAuth2Client.php (100%) rename lib/{OAuth2 => }/Model/IOAuth2RefreshToken.php (100%) rename lib/{OAuth2 => }/Model/IOAuth2Token.php (100%) rename lib/{OAuth2 => }/Model/OAuth2AccessToken.php (100%) rename lib/{OAuth2 => }/Model/OAuth2AuthCode.php (100%) rename lib/{OAuth2 => }/Model/OAuth2Client.php (100%) rename lib/{OAuth2 => }/Model/OAuth2RefreshToken.php (100%) rename lib/{OAuth2 => }/Model/OAuth2Token.php (100%) rename lib/{OAuth2 => }/OAuth2.php (100%) rename lib/{OAuth2 => }/OAuth2AuthenticateException.php (100%) rename lib/{OAuth2 => }/OAuth2Client.php (100%) rename lib/{OAuth2 => }/OAuth2Exception.php (100%) rename lib/{OAuth2 => }/OAuth2RedirectException.php (100%) rename lib/{OAuth2 => }/OAuth2ServerException.php (100%) rename tests/{OAuth2/Tests => }/Fixtures/OAuth2GrantCodeStub.php (100%) rename tests/{OAuth2/Tests => }/Fixtures/OAuth2GrantExtensionLifetimeStub.php (100%) rename tests/{OAuth2/Tests => }/Fixtures/OAuth2GrantExtensionStub.php (100%) rename tests/{OAuth2/Tests => }/Fixtures/OAuth2GrantUserStub.php (100%) rename tests/{OAuth2/Tests => }/Fixtures/OAuth2StorageStub.php (100%) rename tests/{OAuth2/Tests => }/Model/OAuth2TokenTest.php (100%) diff --git a/.travis.yml b/.travis.yml index e71235f..731a9c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,12 +4,12 @@ php: - 5.3 - 5.4 - 5.5 + - 5.6 - hhvm -matrix: - allow_failures: - - php: hhvm - before_script: - curl -s http://getcomposer.org/installer | php - php composer.phar --dev install + +script: + - vendor/bin/phpunit diff --git a/README.md b/README.md index 1422f4e..1a25f19 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ OAuth2 Server Implementation ============================ [![Build Status](https://secure.travis-ci.org/FriendsOfSymfony/oauth2-php.png?branch=master)](http://travis-ci.org/FriendsOfSymfony/oauth2-php) +[![HHVM Status](http://hhvm.h4cc.de/badge/FriendsOfSymfony/oauth2-php.svg)](http://hhvm.h4cc.de/package/FriendsOfSymfony/oauth2-php) This library now implements draft 20 of OAuth 2.0. The client is still only draft-10. @@ -10,7 +11,7 @@ This version of oauth2-php is a fork of https://github.com/quizlet/oauth2-php wi - Namespaced - No more require(_once) - - [PSR-0](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md) autoloading compatible + - [PSR-4](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md) autoloading compatible - Uses [HttpFoundation](https://github.com/symfony/HttpFoundation) Request and Response for input/output - More testable design - Better test coverage diff --git a/composer.json b/composer.json index d670026..bc9dd85 100644 --- a/composer.json +++ b/composer.json @@ -19,8 +19,14 @@ "php": ">=5.3.2", "symfony/http-foundation": "~2.0" }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, "autoload": { - "psr-0": { "OAuth2": "lib/" } + "psr-4": { "OAuth2\\": "lib/" } + }, + "autoload-dev": { + "psr-4": { "OAuth2\\Tests\\": "tests/" } }, "extra": { "branch-alias": { diff --git a/lib/OAuth2/IOAuth2GrantClient.php b/lib/IOAuth2GrantClient.php similarity index 100% rename from lib/OAuth2/IOAuth2GrantClient.php rename to lib/IOAuth2GrantClient.php diff --git a/lib/OAuth2/IOAuth2GrantCode.php b/lib/IOAuth2GrantCode.php similarity index 100% rename from lib/OAuth2/IOAuth2GrantCode.php rename to lib/IOAuth2GrantCode.php diff --git a/lib/OAuth2/IOAuth2GrantExtension.php b/lib/IOAuth2GrantExtension.php similarity index 100% rename from lib/OAuth2/IOAuth2GrantExtension.php rename to lib/IOAuth2GrantExtension.php diff --git a/lib/OAuth2/IOAuth2GrantImplicit.php b/lib/IOAuth2GrantImplicit.php similarity index 100% rename from lib/OAuth2/IOAuth2GrantImplicit.php rename to lib/IOAuth2GrantImplicit.php diff --git a/lib/OAuth2/IOAuth2GrantUser.php b/lib/IOAuth2GrantUser.php similarity index 100% rename from lib/OAuth2/IOAuth2GrantUser.php rename to lib/IOAuth2GrantUser.php diff --git a/lib/OAuth2/IOAuth2RefreshTokens.php b/lib/IOAuth2RefreshTokens.php similarity index 100% rename from lib/OAuth2/IOAuth2RefreshTokens.php rename to lib/IOAuth2RefreshTokens.php diff --git a/lib/OAuth2/IOAuth2Storage.php b/lib/IOAuth2Storage.php similarity index 100% rename from lib/OAuth2/IOAuth2Storage.php rename to lib/IOAuth2Storage.php diff --git a/lib/OAuth2/Model/IOAuth2AccessToken.php b/lib/Model/IOAuth2AccessToken.php similarity index 100% rename from lib/OAuth2/Model/IOAuth2AccessToken.php rename to lib/Model/IOAuth2AccessToken.php diff --git a/lib/OAuth2/Model/IOAuth2AuthCode.php b/lib/Model/IOAuth2AuthCode.php similarity index 100% rename from lib/OAuth2/Model/IOAuth2AuthCode.php rename to lib/Model/IOAuth2AuthCode.php diff --git a/lib/OAuth2/Model/IOAuth2Client.php b/lib/Model/IOAuth2Client.php similarity index 100% rename from lib/OAuth2/Model/IOAuth2Client.php rename to lib/Model/IOAuth2Client.php diff --git a/lib/OAuth2/Model/IOAuth2RefreshToken.php b/lib/Model/IOAuth2RefreshToken.php similarity index 100% rename from lib/OAuth2/Model/IOAuth2RefreshToken.php rename to lib/Model/IOAuth2RefreshToken.php diff --git a/lib/OAuth2/Model/IOAuth2Token.php b/lib/Model/IOAuth2Token.php similarity index 100% rename from lib/OAuth2/Model/IOAuth2Token.php rename to lib/Model/IOAuth2Token.php diff --git a/lib/OAuth2/Model/OAuth2AccessToken.php b/lib/Model/OAuth2AccessToken.php similarity index 100% rename from lib/OAuth2/Model/OAuth2AccessToken.php rename to lib/Model/OAuth2AccessToken.php diff --git a/lib/OAuth2/Model/OAuth2AuthCode.php b/lib/Model/OAuth2AuthCode.php similarity index 100% rename from lib/OAuth2/Model/OAuth2AuthCode.php rename to lib/Model/OAuth2AuthCode.php diff --git a/lib/OAuth2/Model/OAuth2Client.php b/lib/Model/OAuth2Client.php similarity index 100% rename from lib/OAuth2/Model/OAuth2Client.php rename to lib/Model/OAuth2Client.php diff --git a/lib/OAuth2/Model/OAuth2RefreshToken.php b/lib/Model/OAuth2RefreshToken.php similarity index 100% rename from lib/OAuth2/Model/OAuth2RefreshToken.php rename to lib/Model/OAuth2RefreshToken.php diff --git a/lib/OAuth2/Model/OAuth2Token.php b/lib/Model/OAuth2Token.php similarity index 100% rename from lib/OAuth2/Model/OAuth2Token.php rename to lib/Model/OAuth2Token.php diff --git a/lib/OAuth2/OAuth2.php b/lib/OAuth2.php similarity index 100% rename from lib/OAuth2/OAuth2.php rename to lib/OAuth2.php diff --git a/lib/OAuth2/OAuth2AuthenticateException.php b/lib/OAuth2AuthenticateException.php similarity index 100% rename from lib/OAuth2/OAuth2AuthenticateException.php rename to lib/OAuth2AuthenticateException.php diff --git a/lib/OAuth2/OAuth2Client.php b/lib/OAuth2Client.php similarity index 100% rename from lib/OAuth2/OAuth2Client.php rename to lib/OAuth2Client.php diff --git a/lib/OAuth2/OAuth2Exception.php b/lib/OAuth2Exception.php similarity index 100% rename from lib/OAuth2/OAuth2Exception.php rename to lib/OAuth2Exception.php diff --git a/lib/OAuth2/OAuth2RedirectException.php b/lib/OAuth2RedirectException.php similarity index 100% rename from lib/OAuth2/OAuth2RedirectException.php rename to lib/OAuth2RedirectException.php diff --git a/lib/OAuth2/OAuth2ServerException.php b/lib/OAuth2ServerException.php similarity index 100% rename from lib/OAuth2/OAuth2ServerException.php rename to lib/OAuth2ServerException.php diff --git a/tests/OAuth2/Tests/Fixtures/OAuth2GrantCodeStub.php b/tests/Fixtures/OAuth2GrantCodeStub.php similarity index 100% rename from tests/OAuth2/Tests/Fixtures/OAuth2GrantCodeStub.php rename to tests/Fixtures/OAuth2GrantCodeStub.php diff --git a/tests/OAuth2/Tests/Fixtures/OAuth2GrantExtensionLifetimeStub.php b/tests/Fixtures/OAuth2GrantExtensionLifetimeStub.php similarity index 100% rename from tests/OAuth2/Tests/Fixtures/OAuth2GrantExtensionLifetimeStub.php rename to tests/Fixtures/OAuth2GrantExtensionLifetimeStub.php diff --git a/tests/OAuth2/Tests/Fixtures/OAuth2GrantExtensionStub.php b/tests/Fixtures/OAuth2GrantExtensionStub.php similarity index 100% rename from tests/OAuth2/Tests/Fixtures/OAuth2GrantExtensionStub.php rename to tests/Fixtures/OAuth2GrantExtensionStub.php diff --git a/tests/OAuth2/Tests/Fixtures/OAuth2GrantUserStub.php b/tests/Fixtures/OAuth2GrantUserStub.php similarity index 100% rename from tests/OAuth2/Tests/Fixtures/OAuth2GrantUserStub.php rename to tests/Fixtures/OAuth2GrantUserStub.php diff --git a/tests/OAuth2/Tests/Fixtures/OAuth2StorageStub.php b/tests/Fixtures/OAuth2StorageStub.php similarity index 100% rename from tests/OAuth2/Tests/Fixtures/OAuth2StorageStub.php rename to tests/Fixtures/OAuth2StorageStub.php diff --git a/tests/OAuth2/Tests/Model/OAuth2TokenTest.php b/tests/Model/OAuth2TokenTest.php similarity index 100% rename from tests/OAuth2/Tests/Model/OAuth2TokenTest.php rename to tests/Model/OAuth2TokenTest.php diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 9a35f1e..9a6e7af 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,4 +1,3 @@ add('OAuth2', __DIR__);