Skip to content

Commit c7fbd14

Browse files
patinthehatgithub-actions[bot]
authored andcommitted
Fix styling
1 parent 5070e75 commit c7fbd14

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

configure.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ function getGithubApiEndpoint(string $endpoint): ?stdClass
150150
CURLOPT_FOLLOWLOCATION => true,
151151
CURLOPT_HTTPGET => true,
152152
CURLOPT_HTTPHEADER => [
153-
'User-Agent: spatie-configure-script/1.0'
153+
'User-Agent: spatie-configure-script/1.0',
154154
],
155155
]);
156156

@@ -171,26 +171,27 @@ function getGithubApiEndpoint(string $endpoint): ?stdClass
171171

172172
function searchCommitsForGithubUsername(): string
173173
{
174-
$authorName = strtolower(trim(shell_exec("git config user.name")));
174+
$authorName = strtolower(trim(shell_exec('git config user.name')));
175175

176176
$committersRaw = shell_exec("git log --author='@users.noreply.github.com' --pretty='%an:%ae' --reverse");
177177
$committersLines = explode("\n", $committersRaw);
178-
$committers = array_filter(array_map(function($line) use ($authorName) {
178+
$committers = array_filter(array_map(function ($line) use ($authorName) {
179179
$line = trim($line);
180180
[$name, $email] = explode(':', $line) + [null, null];
181181

182182
return [
183183
'name' => $name,
184184
'email' => $email,
185-
'isMatch' => strtolower($name) === $authorName && !str_contains($name, '[bot]')
185+
'isMatch' => strtolower($name) === $authorName && ! str_contains($name, '[bot]'),
186186
];
187-
}, $committersLines), fn($item) => $item['isMatch']);
187+
}, $committersLines), fn ($item) => $item['isMatch']);
188188

189189
if (empty($committers)) {
190190
return '';
191191
}
192192

193193
$firstCommitter = reset($committers);
194+
194195
return explode('@', $firstCommitter['email'])[0] ?? '';
195196
}
196197

@@ -210,25 +211,25 @@ function guessGithubUsernameUsingCli()
210211
function guessGithubUsername(): string
211212
{
212213
$username = searchCommitsForGithubUsername();
213-
if (!empty($username)) {
214+
if (! empty($username)) {
214215
return $username;
215216
}
216217

217218
$username = guessGithubUsernameUsingCli();
218-
if (!empty($username)) {
219+
if (! empty($username)) {
219220
return $username;
220221
}
221222

222223
// fall back to using the username from the git remote
223-
$remoteUrl = shell_exec("git config remote.origin.url");
224+
$remoteUrl = shell_exec('git config remote.origin.url');
224225
$remoteUrlParts = explode('/', str_replace(':', '/', trim($remoteUrl)));
225226

226227
return $remoteUrlParts[1] ?? '';
227228
}
228229

229230
function guessGithubVendorInfo($authorName, $username): array
230231
{
231-
$remoteUrl = shell_exec("git config remote.origin.url");
232+
$remoteUrl = shell_exec('git config remote.origin.url');
232233
$remoteUrlParts = explode('/', str_replace(':', '/', trim($remoteUrl)));
233234

234235
$response = getGithubApiEndpoint("orgs/{$remoteUrlParts[1]}");

0 commit comments

Comments
 (0)