Skip to content

Commit 9c2601a

Browse files
author
Luca Degasperi
committed
PSR2 Syntax
1 parent ffc58df commit 9c2601a

File tree

3 files changed

+64
-67
lines changed

3 files changed

+64
-67
lines changed

src/LucaDegasperi/OAuth2Server/Commands/ExpiredTokensCommand.php

Lines changed: 62 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -7,76 +7,75 @@
77

88
class ExpiredTokensCommand extends Command
99
{
10-
/**
11-
* The console command name.
12-
*
13-
* @var string
14-
*/
15-
protected $name = 'oauth:expired-tokens';
10+
/**
11+
* The console command name.
12+
*
13+
* @var string
14+
*/
15+
protected $name = 'oauth:expired-tokens';
1616

17-
/**
18-
* The console command description.
19-
*
20-
* @var string
21-
*/
22-
protected $description = 'A command to delete the OAuth expired tokens';
17+
/**
18+
* The console command description.
19+
*
20+
* @var string
21+
*/
22+
protected $description = 'A command to delete the OAuth expired tokens';
2323

2424

25-
protected $sessions;
25+
protected $sessions;
2626

27-
/**
28-
* Create a new command instance.
29-
*
30-
* @return void
31-
*/
32-
public function __construct(SessionManagementInterface $sessions)
33-
{
34-
parent::__construct();
27+
/**
28+
* Create a new command instance.
29+
*
30+
* @return void
31+
*/
32+
public function __construct(SessionManagementInterface $sessions)
33+
{
34+
parent::__construct();
3535

36-
$this->sessions = $sessions;
37-
}
36+
$this->sessions = $sessions;
37+
}
3838

39-
/**
40-
* Execute the console command.
41-
*
42-
* @return void
43-
*/
44-
public function fire()
45-
{
46-
$value = $this->option('delete');
47-
if ($value === true) {
48-
$result = $this->deleteExpiredTokens();
49-
$this->info($result . ' expired OAuth tokens were deleted');
50-
}
51-
else {
52-
$this->info('use the --delete option to trigger the delete of the expired tokens');
53-
}
54-
}
39+
/**
40+
* Execute the console command.
41+
*
42+
* @return void
43+
*/
44+
public function fire()
45+
{
46+
$value = $this->option('delete');
47+
if ($value === true) {
48+
$result = $this->deleteExpiredTokens();
49+
$this->info($result . ' expired OAuth tokens were deleted');
50+
} else {
51+
$this->info('use the --delete option to trigger the delete of the expired tokens');
52+
}
53+
}
5554

56-
/**
57-
* Get the console command arguments.
58-
*
59-
* @return array
60-
*/
61-
protected function getArguments()
62-
{
63-
return array();
64-
}
55+
/**
56+
* Get the console command arguments.
57+
*
58+
* @return array
59+
*/
60+
protected function getArguments()
61+
{
62+
return array();
63+
}
6564

66-
/**
67-
* Get the console command options.
68-
*
69-
* @return array
70-
*/
71-
protected function getOptions()
72-
{
73-
return array(
74-
array('delete', null, InputOption::VALUE_NONE, 'Effectively delete the tokens', null),
75-
);
76-
}
65+
/**
66+
* Get the console command options.
67+
*
68+
* @return array
69+
*/
70+
protected function getOptions()
71+
{
72+
return array(
73+
array('delete', null, InputOption::VALUE_NONE, 'Effectively delete the tokens', null),
74+
);
75+
}
7776

78-
protected function deleteExpiredTokens()
79-
{
80-
return $this->sessions->deleteExpired();
81-
}
77+
protected function deleteExpiredTokens()
78+
{
79+
return $this->sessions->deleteExpired();
80+
}
8281
}

src/LucaDegasperi/OAuth2Server/OAuth2ServerServiceProvider.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ public function register()
8888

8989
});
9090

91-
$app['oauth2.expired-tokens-command'] = $app->share(function ($app)
92-
{
91+
$app['oauth2.expired-tokens-command'] = $app->share(function ($app) {
9392
return $app->make('LucaDegasperi\OAuth2Server\Commands\ExpiredTokensCommand');
9493
});
9594

src/LucaDegasperi/OAuth2Server/Repositories/FluentSession.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,7 @@ public function deleteExpired()
190190
->get();
191191
if (count($expiredSessions) == 0) {
192192
return 0;
193-
}
194-
else {
193+
} else {
195194
foreach ($expiredSessions as $session) {
196195
DB::table('oauth_sessions')
197196
->where('id', '=', $session->id)

0 commit comments

Comments
 (0)