Applied fixes from StyleCI

This commit is contained in:
Alex Bilbie
2016-02-19 18:09:39 -05:00
committed by StyleCI Bot
parent 60c45ab8fe
commit a2460886f6
57 changed files with 346 additions and 330 deletions

View File

@@ -3,19 +3,17 @@
use League\OAuth2\Server\Exception\OAuthServerException;
use League\OAuth2\Server\Grant\AuthCodeGrant;
use League\OAuth2\Server\Server;
use OAuth2ServerExamples\Repositories\AccessTokenRepository;
use OAuth2ServerExamples\Repositories\AuthCodeRepository;
use OAuth2ServerExamples\Repositories\ClientRepository;
use OAuth2ServerExamples\Repositories\RefreshTokenRepository;
use OAuth2ServerExamples\Repositories\ScopeRepository;
use OAuth2ServerExamples\Repositories\UserRepository;
use Slim\App;
use Slim\Http\Request;
use Slim\Http\Response;
include(__DIR__ . '/../vendor/autoload.php');
include __DIR__.'/../vendor/autoload.php';
// App
$app = new App([
@@ -29,8 +27,8 @@ $app = new App([
$refreshTokenRepository = new RefreshTokenRepository();
$authCodeRepository = new AuthCodeRepository();
$privateKeyPath = 'file://' . __DIR__ . '/../private.key';
$publicKeyPath = 'file://' . __DIR__ . '/../public.key';
$privateKeyPath = 'file://'.__DIR__.'/../private.key';
$publicKeyPath = 'file://'.__DIR__.'/../public.key';
// Setup the authorization server
$server = new Server(

View File

@@ -3,16 +3,14 @@
use League\OAuth2\Server\Exception\OAuthServerException;
use League\OAuth2\Server\Grant\ClientCredentialsGrant;
use League\OAuth2\Server\Server;
use OAuth2ServerExamples\Repositories\AccessTokenRepository;
use OAuth2ServerExamples\Repositories\ClientRepository;
use OAuth2ServerExamples\Repositories\ScopeRepository;
use Slim\App;
use Slim\Http\Request;
use Slim\Http\Response;
include(__DIR__ . '/../vendor/autoload.php');
include __DIR__.'/../vendor/autoload.php';
// App
$app = new App([
@@ -23,8 +21,8 @@ $app = new App([
$scopeRepository = new ScopeRepository();
$accessTokenRepository = new AccessTokenRepository();
$privateKeyPath = 'file://' . __DIR__ . '/../private.key';
$publicKeyPath = 'file://' . __DIR__ . '/../public.key';
$privateKeyPath = 'file://'.__DIR__.'/../private.key';
$publicKeyPath = 'file://'.__DIR__.'/../public.key';
// Setup the authorization server
$server = new Server(
@@ -39,7 +37,7 @@ $app = new App([
$server->enableGrantType(new ClientCredentialsGrant(), new \DateInterval('PT1H'));
return $server;
}
},
]);
$app->post('/access_token', function (Request $request, Response $response) {

View File

@@ -4,16 +4,14 @@ use League\OAuth2\Server\Grant\PasswordGrant;
use League\OAuth2\Server\Grant\RefreshTokenGrant;
use League\OAuth2\Server\Middleware\AuthenticationServerMiddleware;
use League\OAuth2\Server\Server;
use OAuth2ServerExamples\Repositories\AccessTokenRepository;
use OAuth2ServerExamples\Repositories\ClientRepository;
use OAuth2ServerExamples\Repositories\RefreshTokenRepository;
use OAuth2ServerExamples\Repositories\ScopeRepository;
use OAuth2ServerExamples\Repositories\UserRepository;
use Slim\App;
include(__DIR__ . '/../vendor/autoload.php');
include __DIR__.'/../vendor/autoload.php';
// App
$app = new App([
@@ -29,8 +27,8 @@ $app = new App([
$userRepository = new UserRepository();
$refreshTokenRepository = new RefreshTokenRepository();
$privateKeyPath = 'file://' . __DIR__ . '/../private.key';
$publicKeyPath = 'file://' . __DIR__ . '/../public.key';
$privateKeyPath = 'file://'.__DIR__.'/../private.key';
$publicKeyPath = 'file://'.__DIR__.'/../public.key';
// Setup the authorization server
$server = new Server(
@@ -52,7 +50,7 @@ $app = new App([
);
return $server;
}
},
]);
$app->post('/access_token', function () {

View File

@@ -3,18 +3,16 @@
use League\OAuth2\Server\Exception\OAuthServerException;
use League\OAuth2\Server\Grant\PasswordGrant;
use League\OAuth2\Server\Server;
use OAuth2ServerExamples\Repositories\AccessTokenRepository;
use OAuth2ServerExamples\Repositories\ClientRepository;
use OAuth2ServerExamples\Repositories\RefreshTokenRepository;
use OAuth2ServerExamples\Repositories\ScopeRepository;
use OAuth2ServerExamples\Repositories\UserRepository;
use Slim\App;
use Slim\Http\Request;
use Slim\Http\Response;
include(__DIR__ . '/../vendor/autoload.php');
include __DIR__.'/../vendor/autoload.php';
// App
$app = new App([
@@ -27,8 +25,8 @@ $app = new App([
$userRepository = new UserRepository();
$refreshTokenRepository = new RefreshTokenRepository();
$privateKeyPath = 'file://' . __DIR__ . '/../private.key';
$publicKeyPath = 'file://' . __DIR__ . '/../public.key';
$privateKeyPath = 'file://'.__DIR__.'/../private.key';
$publicKeyPath = 'file://'.__DIR__.'/../public.key';
// Setup the authorization server
$server = new Server(
@@ -46,7 +44,7 @@ $app = new App([
);
return $server;
}
},
]);
$app->post('/access_token', function (Request $request, Response $response) {

View File

@@ -2,16 +2,14 @@
use League\OAuth2\Server\Middleware\ResourceServerMiddleware;
use League\OAuth2\Server\Server;
use OAuth2ServerExamples\Repositories\AccessTokenRepository;
use OAuth2ServerExamples\Repositories\ClientRepository;
use OAuth2ServerExamples\Repositories\ScopeRepository;
use Slim\App;
use Slim\Http\Request;
use Slim\Http\Response;
include(__DIR__ . '/../vendor/autoload.php');
include __DIR__.'/../vendor/autoload.php';
// App
$app = new App([
@@ -25,8 +23,8 @@ $app = new App([
$scopeRepository = new ScopeRepository();
$accessTokenRepository = new AccessTokenRepository();
$privateKeyPath = 'file://' . __DIR__ . '/../private.key';
$publicKeyPath = 'file://' . __DIR__ . '/../public.key';
$privateKeyPath = 'file://'.__DIR__.'/../private.key';
$publicKeyPath = 'file://'.__DIR__.'/../public.key';
// Setup the authorization server
$server = new Server(
@@ -38,7 +36,7 @@ $app = new App([
);
return $server;
}
},
]);
$app->add(new ResourceServerMiddleware($app->getContainer()->get(Server::class)));
@@ -50,7 +48,7 @@ $app->post('/api/example', function (Request $request, Response $response) {
$params = [
'id' => 1,
'name' => 'Alex',
'city' => 'London'
'city' => 'London',
];
}

View File

@@ -3,19 +3,15 @@
use League\OAuth2\Server\Exception\OAuthServerException;
use League\OAuth2\Server\Grant\RefreshTokenGrant;
use League\OAuth2\Server\Server;
use OAuth2ServerExamples\Repositories\AccessTokenRepository;
use OAuth2ServerExamples\Repositories\ClientRepository;
use OAuth2ServerExamples\Repositories\RefreshTokenRepository;
use OAuth2ServerExamples\Repositories\ScopeRepository;
use Slim\App;
use Slim\Http\Request;
use Slim\Http\Response;
include(__DIR__ . '/../vendor/autoload.php');
include __DIR__.'/../vendor/autoload.php';
// App
$app = new App([Server::class => function () {
@@ -25,8 +21,8 @@ $app = new App([Server::class => function () {
$accessTokenRepository = new AccessTokenRepository();
$refreshTokenRepository = new RefreshTokenRepository();
$privateKeyPath = 'file://' . __DIR__ . '/../private.key';
$publicKeyPath = 'file://' . __DIR__ . '/../public.key';
$privateKeyPath = 'file://'.__DIR__.'/../private.key';
$publicKeyPath = 'file://'.__DIR__.'/../public.key';
// Setup the authorization server
$server = new Server(