| @@ -1,8 +1,6 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | - | |
| 4 | - | |
| 5 | 3 | // 0 - none. |
| 6 | 4 | define( 'GEDEBUG_NONE', 0 ); |
| 7 | 5 | |
| 8 | 6 | // 1 - call logging only. |
| @@ -56,12 +54,10 @@ | ||
| 56 | 54 | * with GitHub(http://developer.github.com/v3/oauth/) use the filters here to |
| 57 | 55 | * provide the credentials. |
| 58 | 56 | */ |
| 59 | 57 | public function set_credentials() { |
| 60 | - | |
| 61 | 58 | $this->client_id = apply_filters( 'github-embed-client-id', $this->client_id ); |
| 62 | 59 | $this->client_secret = apply_filters( 'github-embed-client-secret', $this->client_secret ); |
| 63 | - | |
| 64 | 60 | } |
| 65 | 61 | |
| 66 | 62 | |
| 67 | 63 | |
| @@ -107,11 +103,8 @@ | ||
| 107 | 103 | public function get_repo( $owner, $repository ) { |
| 108 | 104 | |
| 109 | 105 | $this->log( "get_repo( $owner, $repository )", GEDEBUG_CALL ); |
| 110 | 106 | |
| 111 | - $owner = trim( $owner, '/' ); | |
| 112 | - $repository = trim( $repository, '/' ); | |
| 113 | - | |
| 114 | 107 | $results = $this->call_api( "https://api.github.com/repos/$owner/$repository" ); |
| 115 | 108 | |
| 116 | 109 | return json_decode( $results['body'] ); |
| 117 | 110 | |
| @@ -128,11 +121,8 @@ | ||
| 128 | 121 | public function get_repo_commits( $owner, $repository ) { |
| 129 | 122 | |
| 130 | 123 | $this->log( "get_repo_commits( $owner, $repository )", GEDEBUG_CALL ); |
| 131 | 124 | |
| 132 | - $owner = trim( $owner, '/' ); | |
| 133 | - $repository = trim( $repository, '/' ); | |
| 134 | - | |
| 135 | 125 | $results = $this->call_api( "https://api.github.com/repos/$owner/$repository/commits" ); |
| 136 | 126 | |
| 137 | 127 | return json_decode( $results['body'] ); |
| 138 | 128 | |
| @@ -150,11 +140,8 @@ | ||
| 150 | 140 | public function get_repo_milestone_summary( $owner, $repository, $milestone ) { |
| 151 | 141 | |
| 152 | 142 | $this->log( "get_repo_milestone_summary( $owner, $repository, $milestone )", GEDEBUG_CALL ); |
| 153 | 143 | |
| 154 | - $owner = trim( $owner, '/' ); | |
| 155 | - $repo = trim( $repository, '/' ); | |
| 156 | - | |
| 157 | 144 | $results = $this->call_api( "https://api.github.com/repos/$owner/$repository/milestones/$milestone" ); |
| 158 | 145 | |
| 159 | 146 | return json_decode( $results['body'] ); |
| 160 | 147 | |
| @@ -165,11 +152,8 @@ | ||
| 165 | 152 | public function get_repo_contributors( $owner, $repository ) { |
| 166 | 153 | |
| 167 | 154 | $this->log( "get_repo_contributors( $owner, $repository )", GEDEBUG_CALL ); |
| 168 | 155 | |
| 169 | - $owner = trim( $owner, '/' ); | |
| 170 | - $repo = trim( $repository, '/' ); | |
| 171 | - | |
| 172 | 156 | $results = $this->call_api( "https://api.github.com/repos/$owner/$repository/stats/contributors" ); |
| 173 | 157 | |
| 174 | 158 | return json_decode( $results['body'] ); |
| 175 | 159 | |
| @@ -184,10 +168,8 @@ | ||
| 184 | 168 | */ |
| 185 | 169 | public function get_user( $user ) { |
| 186 | 170 | |
| 187 | 171 | $this->log( "get_user( $user )", GEDEBUG_CALL ); |
| 188 | - | |
| 189 | - $user = trim( $user, '/' ); | |
| 190 | 172 | |
| 191 | 173 | $results = $this->call_api( "https://api.github.com/users/$user" ); |
| 192 | 174 | |
| 193 | 175 | return json_decode( $results['body'] ); |