Skip to content

Commit 3576356

Browse files
committed
phpcs 12
1 parent c5079b4 commit 3576356

File tree

4 files changed

+7
-18
lines changed

4 files changed

+7
-18
lines changed

src/Console/Command/Command.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,17 @@
1414

1515
abstract class Command extends IlluminateCommand
1616
{
17-
protected ApiKeyService $apiKeyService;
18-
1917
/**
2018
* Create a new command instance.
2119
*
2220
* @return void
2321
*/
24-
public function __construct(ApiKeyService $apiKeyService)
22+
public function __construct(protected ApiKeyService $apiKeyService)
2523
{
2624
parent::__construct();
27-
28-
$this->apiKeyService = $apiKeyService;
2925
}
3026

31-
/**
32-
* @param ApiKey[] $apiKeys
33-
*/
27+
/** @param ApiKey[] $apiKeys */
3428
protected function printApiKeys(array $apiKeys): void
3529
{
3630
$headers = ['name', 'api_key', 'status', 'scopes'];
@@ -53,9 +47,7 @@ protected function printApiKeys(array $apiKeys): void
5347
$this->table($headers, $rows);
5448
}
5549

56-
/**
57-
* @param Scope[] $scopes
58-
*/
50+
/** @param Scope[] $scopes */
5951
protected function printScopes(array $scopes): void
6052
{
6153
$headers = ['name', 'apikey count'];

src/Http/Middleware/AuthorizeApiKey.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,14 @@
1313

1414
class AuthorizeApiKey
1515
{
16-
private ApiKeyService $apiKeyService;
17-
18-
public function __construct(ApiKeyService $apiKeyService)
16+
public function __construct(private ApiKeyService $apiKeyService)
1917
{
20-
$this->apiKeyService = $apiKeyService;
2118
}
2219

2320
/**
2421
* Handle request
2522
*/
26-
public function handle(Request $request, Closure $next, ?string $scope = null): mixed
23+
public function handle(Request $request, Closure $next, string|null $scope = null): mixed
2724
{
2825
$header = $request->header('Authorization');
2926
if (! $header) {

src/Repository/ApiKeyRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function removeScope(ApiKey $apiKey, Scope $scope): ApiKey
133133

134134
if (! $found) {
135135
throw new ApiKeyDoesNotHaveScope(
136-
'The requested Scope to remove does not exist on the ApiKey'
136+
'The requested Scope to remove does not exist on the ApiKey',
137137
);
138138
}
139139

src/Service/ApiKeyService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
class ApiKeyService
1616
{
17-
private ?EntityManager $entityManager = null;
17+
private EntityManager|null $entityManager = null;
1818

1919
public function getEntityManager(): EntityManager
2020
{

0 commit comments

Comments
 (0)