File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ public static function fetchIssues(string $url): Result {
103
103
$ issue_count = 0 ;
104
104
if ($ repoResult ->err ) {
105
105
try {
106
- $ orgInfo = Github::getOrg ($ org );
106
+ $ orgInfo = Github::getOrgOrUser ($ org );
107
107
$ repoInfo = Github::getRepo ($ org , $ repo );
108
108
if ($ repoInfo ['visibility ' ] !== 'public ' ) {
109
109
return err ('e_repo_not_public ' );
Original file line number Diff line number Diff line change @@ -25,16 +25,22 @@ protected static function client(): Client {
25
25
}
26
26
27
27
/**
28
- * Get repo information
29
- * @param string $org
28
+ * Get org or user information
29
+ * @param string $handle
30
30
* @return array{has_issues:bool,open_issues:int,visibility:string}
31
31
*/
32
- public static function getOrg (
33
- string $ org
32
+ public static function getOrgOrUser (
33
+ string $ handle
34
34
): array {
35
- /** @var \Github\Api\Organization */
36
- $ api = static ::client ()->api ('organization ' );
37
- return $ api ->show ($ org );
35
+ try {
36
+ /** @var \Github\Api\Organization */
37
+ $ api = static ::client ()->api ('organization ' );
38
+ return $ api ->show ($ handle );
39
+ } catch (\Throwable ) {
40
+ /** @var \Github\Api\User */
41
+ $ api = static ::client ()->api ('user ' );
42
+ return $ api ->show ($ handle );
43
+ }
38
44
}
39
45
40
46
/**
You can’t perform that action at this time.
0 commit comments