@@ -153,14 +153,14 @@ discard block |
||
| 153 | 153 | { |
| 154 | 154 | return [ |
| 155 | 155 | //contributors, dependencies, dependent_repositories, dependents, search, sourcerank, or project |
| 156 | - ['{"Hello":"World"}', 'contributors' , ['platform' => 'npm' , 'name' => 'utility']], |
|
| 157 | - ['{"Hello":"World"}', 'dependencies' , ['platform' => 'npm' , 'name' => 'utility', 'version' => 'latest']], |
|
| 158 | - ['{"Hello":"World"}', 'dependent_repositories', ['platform' => 'npm' , 'name' => 'utility']], |
|
| 159 | - ['{"Hello":"World"}', 'dependents' , ['platform' => 'npm' , 'name' => 'utility']], |
|
| 160 | - ['{"Hello":"World"}', 'search' , ['query' => 'grunt', 'sort' => 'rank', 'keywords' => 'wordpress']], |
|
| 161 | - ['{"Hello":"World"}', 'search' , ['query' => 'grunt', 'sort' => 'notvalid', 'keywords' => 'wordpress']], |
|
| 162 | - ['{"Hello":"World"}', 'sourcerank' , ['platform' => 'npm' , 'name' => 'utility']], |
|
| 163 | - ['{"Hello":"World"}', 'project' , ['platform' => 'npm' , 'name' => 'utility', 'page' => 1, 'per_page' => 30]] |
|
| 156 | + ['{"Hello":"World"}', 'contributors', ['platform' => 'npm', 'name' => 'utility']], |
|
| 157 | + ['{"Hello":"World"}', 'dependencies', ['platform' => 'npm', 'name' => 'utility', 'version' => 'latest']], |
|
| 158 | + ['{"Hello":"World"}', 'dependent_repositories', ['platform' => 'npm', 'name' => 'utility']], |
|
| 159 | + ['{"Hello":"World"}', 'dependents', ['platform' => 'npm', 'name' => 'utility']], |
|
| 160 | + ['{"Hello":"World"}', 'search', ['query' => 'grunt', 'sort' => 'rank', 'keywords' => 'wordpress']], |
|
| 161 | + ['{"Hello":"World"}', 'search', ['query' => 'grunt', 'sort' => 'notvalid', 'keywords' => 'wordpress']], |
|
| 162 | + ['{"Hello":"World"}', 'sourcerank', ['platform' => 'npm', 'name' => 'utility']], |
|
| 163 | + ['{"Hello":"World"}', 'project', ['platform' => 'npm', 'name' => 'utility', 'page' => 1, 'per_page' => 30]] |
|
| 164 | 164 | ]; |
| 165 | 165 | } |
| 166 | 166 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | { |
| 183 | 183 | $this->stub->client = $this->client; |
| 184 | 184 | $this->expectException(\InvalidArgumentException::class); |
| 185 | - $response = $this->stub->project('notvalid', ['platform' => 'npm' , 'name' => 'utility']); |
|
| 185 | + $response = $this->stub->project('notvalid', ['platform' => 'npm', 'name' => 'utility']); |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | public function testProjectInvalidOptions(): void |
@@ -198,12 +198,12 @@ discard block |
||
| 198 | 198 | public static function dataRepositoryProvider(): array |
| 199 | 199 | { |
| 200 | 200 | return [ |
| 201 | - ['{"Hello":"World"}', 'dependencies' , ['owner' => 'ericsizemore', 'name' => 'utility']], |
|
| 202 | - ['{"Hello":"World"}', 'projects' , ['owner' => 'ericsizemore', 'name' => 'utility']], |
|
| 203 | - ['{"Hello":"World"}', 'repository' , ['owner' => 'ericsizemore', 'name' => 'utility']], |
|
| 204 | - ['{"Hello":"World"}', 'dependencies' , ['owner' => 'ericsizemore', 'name' => 'utility']], |
|
| 205 | - ['{"Hello":"World"}', 'projects' , ['owner' => 'ericsizemore', 'name' => 'utility', 'page' => 1, 'per_page' => 30]], |
|
| 206 | - ['{"Hello":"World"}', 'repository' , ['owner' => 'ericsizemore', 'name' => 'utility']], |
|
| 201 | + ['{"Hello":"World"}', 'dependencies', ['owner' => 'ericsizemore', 'name' => 'utility']], |
|
| 202 | + ['{"Hello":"World"}', 'projects', ['owner' => 'ericsizemore', 'name' => 'utility']], |
|
| 203 | + ['{"Hello":"World"}', 'repository', ['owner' => 'ericsizemore', 'name' => 'utility']], |
|
| 204 | + ['{"Hello":"World"}', 'dependencies', ['owner' => 'ericsizemore', 'name' => 'utility']], |
|
| 205 | + ['{"Hello":"World"}', 'projects', ['owner' => 'ericsizemore', 'name' => 'utility', 'page' => 1, 'per_page' => 30]], |
|
| 206 | + ['{"Hello":"World"}', 'repository', ['owner' => 'ericsizemore', 'name' => 'utility']], |
|
| 207 | 207 | ]; |
| 208 | 208 | } |
| 209 | 209 | |
@@ -241,12 +241,12 @@ discard block |
||
| 241 | 241 | public static function dataUserProvider(): array |
| 242 | 242 | { |
| 243 | 243 | return [ |
| 244 | - ['{"Hello":"World"}', 'dependencies' , ['login' => 'ericsizemore']], |
|
| 245 | - ['{"Hello":"World"}', 'package_contributions' , ['login' => 'ericsizemore']], |
|
| 246 | - ['{"Hello":"World"}', 'packages' , ['login' => 'ericsizemore']], |
|
| 247 | - ['{"Hello":"World"}', 'repositories' , ['login' => 'ericsizemore']], |
|
| 244 | + ['{"Hello":"World"}', 'dependencies', ['login' => 'ericsizemore']], |
|
| 245 | + ['{"Hello":"World"}', 'package_contributions', ['login' => 'ericsizemore']], |
|
| 246 | + ['{"Hello":"World"}', 'packages', ['login' => 'ericsizemore']], |
|
| 247 | + ['{"Hello":"World"}', 'repositories', ['login' => 'ericsizemore']], |
|
| 248 | 248 | ['{"Hello":"World"}', 'repository_contributions', ['login' => 'ericsizemore', 'page' => 1, 'per_page' => 30]], |
| 249 | - ['{"Hello":"World"}', 'subscriptions' , []] |
|
| 249 | + ['{"Hello":"World"}', 'subscriptions', []] |
|
| 250 | 250 | ]; |
| 251 | 251 | } |
| 252 | 252 | |
@@ -371,28 +371,28 @@ |
||
| 371 | 371 | public function endpointParameters(string $endpoint, string $subset): array |
| 372 | 372 | { |
| 373 | 373 | static $projectParameters = [ |
| 374 | - 'contributors' => ['format' => ':platform/:name/contributors' , 'options' => ['platform', 'name']], |
|
| 375 | - 'dependencies' => ['format' => ':platform/:name/:version/dependencies' , 'options' => ['platform', 'name', 'version']], |
|
| 374 | + 'contributors' => ['format' => ':platform/:name/contributors', 'options' => ['platform', 'name']], |
|
| 375 | + 'dependencies' => ['format' => ':platform/:name/:version/dependencies', 'options' => ['platform', 'name', 'version']], |
|
| 376 | 376 | 'dependent_repositories' => ['format' => ':platform/:name/dependent_repositories', 'options' => ['platform', 'name']], |
| 377 | - 'dependents' => ['format' => ':platform/:name/dependents' , 'options' => ['platform', 'name']], |
|
| 378 | - 'search' => ['format' => 'search' , 'options' => ['query', 'sort']], |
|
| 379 | - 'sourcerank' => ['format' => ':platform/:name/sourcerank' , 'options' => ['platform', 'name']], |
|
| 380 | - 'project' => ['format' => ':platform/:name' , 'options' => ['platform', 'name']] |
|
| 377 | + 'dependents' => ['format' => ':platform/:name/dependents', 'options' => ['platform', 'name']], |
|
| 378 | + 'search' => ['format' => 'search', 'options' => ['query', 'sort']], |
|
| 379 | + 'sourcerank' => ['format' => ':platform/:name/sourcerank', 'options' => ['platform', 'name']], |
|
| 380 | + 'project' => ['format' => ':platform/:name', 'options' => ['platform', 'name']] |
|
| 381 | 381 | ]; |
| 382 | 382 | |
| 383 | 383 | static $repositoryParameters = [ |
| 384 | 384 | 'dependencies' => ['format' => 'github/:owner/:name/dependencies', 'options' => ['owner', 'name']], |
| 385 | - 'projects' => ['format' => 'github/:owner/:name/projects' , 'options' => ['owner', 'name']], |
|
| 386 | - 'repository' => ['format' => 'github/:owner/:name' , 'options' => ['owner', 'name']] |
|
| 385 | + 'projects' => ['format' => 'github/:owner/:name/projects', 'options' => ['owner', 'name']], |
|
| 386 | + 'repository' => ['format' => 'github/:owner/:name', 'options' => ['owner', 'name']] |
|
| 387 | 387 | ]; |
| 388 | 388 | |
| 389 | 389 | static $userParameters = [ |
| 390 | - 'dependencies' => ['format' => 'github/:login/dependencies' , 'options' => ['login']], |
|
| 391 | - 'package_contributions' => ['format' => 'github/:login/project-contributions' , 'options' => ['login']], |
|
| 392 | - 'packages' => ['format' => 'github/:login/projects' , 'options' => ['login']], |
|
| 393 | - 'repositories' => ['format' => 'github/:login/repositories' , 'options' => ['login']], |
|
| 390 | + 'dependencies' => ['format' => 'github/:login/dependencies', 'options' => ['login']], |
|
| 391 | + 'package_contributions' => ['format' => 'github/:login/project-contributions', 'options' => ['login']], |
|
| 392 | + 'packages' => ['format' => 'github/:login/projects', 'options' => ['login']], |
|
| 393 | + 'repositories' => ['format' => 'github/:login/repositories', 'options' => ['login']], |
|
| 394 | 394 | 'repository_contributions' => ['format' => 'github/:login/repository-contributions', 'options' => ['login']], |
| 395 | - 'subscriptions' => ['format' => 'subscriptions' , 'options' => []] |
|
| 395 | + 'subscriptions' => ['format' => 'subscriptions', 'options' => []] |
|
| 396 | 396 | ]; |
| 397 | 397 | |
| 398 | 398 | return match($endpoint) { |
@@ -417,7 +417,7 @@ discard block |
||
| 417 | 417 | return $format; |
| 418 | 418 | } |
| 419 | 419 | |
| 420 | - foreach ($options AS $key => $val) { |
|
| 420 | + foreach ($options as $key => $val) { |
|
| 421 | 421 | if ($key === 'page' || $key === 'per_page') { |
| 422 | 422 | continue; |
| 423 | 423 | } |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | { |
| 440 | 440 | $noError = true; |
| 441 | 441 | |
| 442 | - foreach ($endpointOptions AS $endpointOption) { |
|
| 442 | + foreach ($endpointOptions as $endpointOption) { |
|
| 443 | 443 | if (!isset($options[$endpointOption])) { |
| 444 | 444 | $noError = false; |
| 445 | 445 | break; |