Skip to content

Commit 4792f58

Browse files
committed
Run mago
1 parent ef0fad1 commit 4792f58

340 files changed

Lines changed: 1165 additions & 1121 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/auth/src/AccessControl/PolicyBasedAccessControl.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ private function findPoliciesForResourceAction(object|string $resource, UnitEnum
8585
$actionBeingEvaluated = Str\parse($action);
8686

8787
return new ImmutableArray($this->authConfig->policies[$resource] ?? [])
88-
->filter(fn ($_, string $action) => $action === $actionBeingEvaluated)
88+
->filter(static fn ($_, string $action) => $action === $actionBeingEvaluated)
8989
->flatten();
9090
}
9191

@@ -96,13 +96,13 @@ private function evaluatePolicy(MethodReflector $policy, ?object $resource, ?obj
9696
$this->ensureParameterAcceptsInput(
9797
reflector: $policy->getParameter(key: 0),
9898
input: $resource,
99-
throw: fn (string $expected) => throw PolicyMethodWasInvalid::resourceParameterIsInvalid($policyName, $expected),
99+
throw: static fn (string $expected) => throw PolicyMethodWasInvalid::resourceParameterIsInvalid($policyName, $expected),
100100
);
101101

102102
$this->ensureParameterAcceptsInput(
103103
reflector: $policy->getParameter(key: 1),
104104
input: $subject,
105-
throw: fn (string $expected) => throw PolicyMethodWasInvalid::subjectParameterIsInvalid($policyName, $expected),
105+
throw: static fn (string $expected) => throw PolicyMethodWasInvalid::subjectParameterIsInvalid($policyName, $expected),
106106
);
107107

108108
$decision = $policy->invokeArgs(

packages/auth/src/AccessControl/PolicyDiscovery.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Tempest\Auth\AccessControl;
44

5-
use Tempest\Auth\AccessControl\Policy;
65
use Tempest\Auth\AuthConfig;
76
use Tempest\Discovery\Discovery;
87
use Tempest\Discovery\DiscoveryLocation;

packages/auth/src/Installer/OAuthInstaller.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function install(): void
5353
'3. Review and customize the published files if needed',
5454
'',
5555
'<strong>Published files</strong>',
56-
...arr($this->publishedFiles)->map(fn (string $file) => '<style="fg-green">→</style> ' . $file),
56+
...arr($this->publishedFiles)->map(static fn (string $file) => '<style="fg-green">→</style> ' . $file),
5757
]);
5858
}
5959

@@ -108,7 +108,7 @@ private function publishController(SupportedOAuthProvider $provider): void
108108

109109
$this->update(
110110
path: $destination,
111-
callback: fn (ImmutableString $contents) => $contents->replace(
111+
callback: static fn (ImmutableString $contents) => $contents->replace(
112112
search: [
113113
"'tag_name'",
114114
'redirect-route',
@@ -132,7 +132,7 @@ private function publishController(SupportedOAuthProvider $provider): void
132132
private function installComposerDependencies(SupportedOAuthProvider ...$providers): void
133133
{
134134
$packages = arr($providers)
135-
->map(fn (SupportedOAuthProvider $provider) => $provider->composerPackage())
135+
->map(static fn (SupportedOAuthProvider $provider) => $provider->composerPackage())
136136
->filter();
137137

138138
if ($packages->isNotEmpty()) {
@@ -167,7 +167,7 @@ private function extractSettings(SupportedOAuthProvider $provider): array
167167
try {
168168
return str(read_file($configPath))
169169
->matchAll("/env\('(OAUTH_[^']*)'/", matches: 1)
170-
->map(fn (array $matches) => $matches[1] ?? null)
170+
->map(static fn (array $matches) => $matches[1] ?? null)
171171
->filter()
172172
->toArray();
173173
} catch (PathWasNotFound|PathWasNotReadable) {

packages/auth/src/Installer/oauth/OAuthControllerStub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function callback(Request $request): Redirect
3636

3737
$this->oauth->authenticate(
3838
request: $request,
39-
map: fn (OAuthUser $user): Authenticatable => query('user-model-fqcn')->updateOrCreate([
39+
map: static fn (OAuthUser $user): Authenticatable => query('user-model-fqcn')->updateOrCreate([
4040
'provider_db_column' => $user->id,
4141
], [
4242
'provider_db_column' => $user->id,

packages/auth/src/OAuth/Config/DiscordOAuthConfig.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public function __construct(
2525
/**
2626
* The client secret for the Discord OAuth application.
2727
*/
28+
#[\SensitiveParameter]
2829
public string $clientSecret,
2930

3031
/**

packages/auth/src/OAuth/Config/FacebookOAuthConfig.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public function __construct(
2626
/**
2727
* The client secret for the Facebook OAuth application.
2828
*/
29+
#[\SensitiveParameter]
2930
public string $clientSecret,
3031

3132
/**

packages/auth/src/OAuth/Config/GenericOAuthConfig.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public function __construct(
2525
/**
2626
* The client secret for the OAuth provider.
2727
*/
28+
#[\SensitiveParameter]
2829
public string $clientSecret,
2930

3031
/**
@@ -40,6 +41,7 @@ public function __construct(
4041
/**
4142
* The access token URL for the OAuth provider.
4243
*/
44+
#[\SensitiveParameter]
4345
public string $urlAccessToken,
4446

4547
/**

packages/auth/src/OAuth/Config/GitHubOAuthConfig.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public function __construct(
2626
/**
2727
* The client secret for the GitHub OAuth application.
2828
*/
29+
#[\SensitiveParameter]
2930
public string $clientSecret,
3031

3132
/**

packages/auth/src/OAuth/Config/GoogleOAuthConfig.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public function __construct(
2626
/**
2727
* The client secret for the Google OAuth application.
2828
*/
29+
#[\SensitiveParameter]
2930
public string $clientSecret,
3031

3132
/**

packages/auth/src/OAuth/Config/InstagramOAuthConfig.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public function __construct(
2525
/**
2626
* The client secret for the Instagram OAuth application.
2727
*/
28+
#[\SensitiveParameter]
2829
public string $clientSecret,
2930

3031
/**

0 commit comments

Comments
 (0)