Skip to content

Commit 5462f20

Browse files
committed
Merge branch 'master' of github.com:lucadegasperi/oauth2-server-laravel
2 parents add78bb + f1899c7 commit 5462f20

File tree

5 files changed

+25
-11
lines changed

5 files changed

+25
-11
lines changed

CONTRIBUTING.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Thanks for contributing to this project.
2+
3+
Everytime you open an issue please state which version of Laravel are you using and which version of this package are you using.
4+
This is very important so that problems can be issued quicker.
5+
6+
7+
Please ensure that you run `phpunit` from the project root after you've made any changes.
8+
9+
If you've added something new please create a new unit test, if you've changed something please update any unit tests as appropritate.
10+
11+
We're trying to ensure there is **100%** test code coverage (including testing PHP errors and exceptions) so please ensure any new/updated tests cover all of your changes.
12+
13+
Thank you,
14+
15+
@lucadegasperi

src/Authorizer.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,11 @@ public function getChecker()
7373

7474
/**
7575
* Issue an access token if the request parameters are valid
76-
* @param array $params optional array of parsed $_POST keys
7776
* @return array a response object for the protocol in use
7877
*/
79-
public function issueAccessToken($params = [])
78+
public function issueAccessToken()
8079
{
81-
return $this->issuer->issueAccessToken($params);
80+
return $this->issuer->issueAccessToken();
8281
}
8382

8483
/**

src/Console/MigrationsCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct()
4747
*/
4848
public function fire()
4949
{
50-
$this->call('migrate:publish', ['package' => 'lucadegasperi/oauth2-server-laravel']);
50+
$this->call('publish:migration', ['package' => 'lucadegasperi/oauth2-server-laravel']);
5151
$this->call('dump-autoload');
5252
}
5353
}

src/OAuth2ServerServiceProvider.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use LucaDegasperi\OAuth2Server\Filters\CheckAuthCodeRequestFilter;
1818
use LucaDegasperi\OAuth2Server\Filters\OAuthFilter;
1919
use LucaDegasperi\OAuth2Server\Filters\OAuthOwnerFilter;
20+
use Illuminate\Contracts\Exception\Handler;
2021

2122
class OAuth2ServerServiceProvider extends ServiceProvider
2223
{
@@ -30,10 +31,10 @@ class OAuth2ServerServiceProvider extends ServiceProvider
3031
* Bootstrap the application events.
3132
* @return void
3233
*/
33-
public function boot()
34+
public function boot(Handler $handler)
3435
{
3536
$this->package('lucadegasperi/oauth2-server-laravel', 'oauth2-server-laravel', __DIR__.'/');
36-
37+
$this->registerErrorHandlers($handler);
3738
$this->bootFilters();
3839
}
3940

@@ -43,7 +44,6 @@ public function boot()
4344
*/
4445
public function register()
4546
{
46-
$this->registerErrorHandlers();
4747
$this->registerAuthorizer();
4848
$this->registerFilterBindings();
4949
$this->registerCommands();
@@ -162,9 +162,9 @@ private function bootFilters()
162162
* Register the OAuth error handlers
163163
* @return void
164164
*/
165-
private function registerErrorHandlers()
165+
private function registerErrorHandlers(Handler $handler)
166166
{
167-
$this->app->error(function(OAuthException $e) {
167+
$handler->error(function(OAuthException $e) {
168168
return new JsonResponse([
169169
'error' => $e->errorType,
170170
'error_description' => $e->getMessage()

tests/unit/LucaDegasperi/OAuth2Server/AuthorizerSpec.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ function it_is_initializable()
2424

2525
function it_issues_an_access_token(AuthorizationServer $issuer)
2626
{
27-
$issuer->issueAccessToken([])->willReturn('foo')->shouldBeCalled();
27+
$issuer->issueAccessToken()->willReturn('foo')->shouldBeCalled();
2828

29-
$this->issueAccessToken([])->shouldReturn('foo');
29+
$this->issueAccessToken()->shouldReturn('foo');
3030
}
3131

3232
function it_checks_the_auth_code_request_parameters(AuthorizationServer $issuer, AuthCodeGrant $authCodeGrant)

0 commit comments

Comments
 (0)