Skip to content

Commit 9c8bc5a

Browse files
committed
Cleanup.
1 parent fa85295 commit 9c8bc5a

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/vendor
22
composer.phar
33
composer.lock
4-
.DS_Store
4+
.DS_Store
5+
.php_cs.cache

src/Auth/AuthorizesKeyableRequests.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function authorizeKeyable($ability, $object)
2323

2424
if (method_exists($policyClass, 'before')) {
2525
$before = $policyClass->before($apiKey, $keyable, $object);
26-
if (!is_null($before) && $before) {
26+
if (! is_null($before) && $before) {
2727
return new Response('');
2828
}
2929
}

src/Console/Commands/GenerateApiKey.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ public function handle()
4949

5050
$apiKey->save();
5151

52-
$this->info('The following API key was created: '.$apiKey->key);
52+
$this->info('The following API key was created: ' . $apiKey->key);
5353
}
5454
}

src/Http/Middleware/AuthenticateApiKey.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ public function handle($request, Closure $next, $guard = null)
2323
$token = $this->getKeyFromRequest($request);
2424

2525
//Check for presence of key
26-
if (!$token) {
26+
if (! $token) {
2727
return $this->unauthorizedResponse();
2828
}
2929

3030
//Get API key
3131
$apiKey = ApiKey::getByKey($token);
3232

3333
//Validate key
34-
if (!($apiKey instanceof ApiKey)) {
34+
if (! ($apiKey instanceof ApiKey)) {
3535
return $this->unauthorizedResponse();
3636
}
3737

@@ -40,11 +40,11 @@ public function handle($request, Closure $next, $guard = null)
4040

4141
//Validate model
4242
if (config('keyable.allow_empty_models', false)) {
43-
if (!$keyable && (!is_null($apiKey->keyable_type) || !is_null($apiKey->keyable_id))) {
43+
if (! $keyable && (! is_null($apiKey->keyable_type) || ! is_null($apiKey->keyable_id))) {
4444
return $this->unauthorizedResponse();
4545
}
4646
} else {
47-
if (!$keyable) {
47+
if (! $keyable) {
4848
return $this->unauthorizedResponse();
4949
}
5050
}

src/KeyableServiceProvider.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ public function register()
4444
*/
4545
private function publishFiles()
4646
{
47-
$this->loadMigrationsFrom(__DIR__.'/../database/migrations');
47+
$this->loadMigrationsFrom(__DIR__ . '/../database/migrations');
4848
$this->publishes([
49-
__DIR__.'/../config/keyable.php' => config_path('keyable.php'),
49+
__DIR__ . '/../config/keyable.php' => config_path('keyable.php'),
5050
]);
5151
}
5252

0 commit comments

Comments
 (0)