@@ -141,7 +141,7 @@ function replaceForAllOtherOSes(): array
141
141
return explode (
PHP_EOL ,
run (
'grep -E -r -l -i ":author|:vendor|:package|VendorName|skeleton|migration_table_name|vendor_name|vendor_slug|[email protected] " --exclude-dir=vendor ./* ./.github/* | grep -v ' .
basename (
__FILE__ )));
142
142
}
143
143
144
- function getGithubApiEndpoint (string $ endpoint ): ?stdClass
144
+ function getGitHubApiEndpoint (string $ endpoint ): ?stdClass
145
145
{
146
146
try {
147
147
$ curl = curl_init ("https://api.github.com/ {$ endpoint }" );
@@ -169,7 +169,7 @@ function getGithubApiEndpoint(string $endpoint): ?stdClass
169
169
return null ;
170
170
}
171
171
172
- function searchCommitsForGithubUsername (): string
172
+ function searchCommitsForGitHubUsername (): string
173
173
{
174
174
$ authorName = strtolower (trim (shell_exec ('git config user.name ' )));
175
175
@@ -195,7 +195,7 @@ function searchCommitsForGithubUsername(): string
195
195
return explode ('@ ' , $ firstCommitter ['email ' ])[0 ] ?? '' ;
196
196
}
197
197
198
- function guessGithubUsernameUsingCli ()
198
+ function guessGitHubUsernameUsingCli ()
199
199
{
200
200
try {
201
201
if (preg_match ('/ogged in to github\.com as ([a-zA-Z-_]+).+/ ' , shell_exec ('gh auth status -h github.com 2>&1 ' ), $ matches )) {
@@ -208,14 +208,14 @@ function guessGithubUsernameUsingCli()
208
208
return '' ;
209
209
}
210
210
211
- function guessGithubUsername (): string
211
+ function guessGitHubUsername (): string
212
212
{
213
- $ username = searchCommitsForGithubUsername ();
213
+ $ username = searchCommitsForGitHubUsername ();
214
214
if (! empty ($ username )) {
215
215
return $ username ;
216
216
}
217
217
218
- $ username = guessGithubUsernameUsingCli ();
218
+ $ username = guessGitHubUsernameUsingCli ();
219
219
if (! empty ($ username )) {
220
220
return $ username ;
221
221
}
@@ -227,12 +227,12 @@ function guessGithubUsername(): string
227
227
return $ remoteUrlParts [1 ] ?? '' ;
228
228
}
229
229
230
- function guessGithubVendorInfo ($ authorName , $ username ): array
230
+ function guessGitHubVendorInfo ($ authorName , $ username ): array
231
231
{
232
232
$ remoteUrl = shell_exec ('git config remote.origin.url ' );
233
233
$ remoteUrlParts = explode ('/ ' , str_replace (': ' , '/ ' , trim ($ remoteUrl )));
234
234
235
- $ response = getGithubApiEndpoint ("orgs/ {$ remoteUrlParts [1 ]}" );
235
+ $ response = getGitHubApiEndpoint ("orgs/ {$ remoteUrlParts [1 ]}" );
236
236
237
237
if ($ response === null ) {
238
238
return $ username ;
@@ -246,12 +246,12 @@ function guessGithubVendorInfo($authorName, $username): array
246
246
247
247
$ gitEmail = run ('git config user.email ' );
248
248
$ authorEmail = ask ('Author email ' , $ gitEmail );
249
- $ authorUsername = ask ('Author username ' , guessGithubUsername ());
249
+ $ authorUsername = ask ('Author username ' , guessGitHubUsername ());
250
250
251
- $ guessGithubVendorInfo = guessGithubVendorInfo ($ authorName , $ authorUsername );
251
+ $ guessGitHubVendorInfo = guessGitHubVendorInfo ($ authorName , $ authorUsername );
252
252
253
- $ vendorName = ask ('Vendor name ' , $ guessGithubVendorInfo [0 ]);
254
- $ vendorUsername = ask ('Vendor username ' , $ guessGithubVendorInfo [1 ] ?? slugify ($ vendorName ));
253
+ $ vendorName = ask ('Vendor name ' , $ guessGitHubVendorInfo [0 ]);
254
+ $ vendorUsername = ask ('Vendor username ' , $ guessGitHubVendorInfo [1 ] ?? slugify ($ vendorName ));
255
255
$ vendorSlug = slugify ($ vendorUsername );
256
256
257
257
$ vendorNamespace = str_replace ('- ' , '' , ucwords ($ vendorName ));
0 commit comments