Passed
Push — master ( 68917c...f87186 )
by Eric
12:23
created
src/LibrariesIO.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -192,9 +192,9 @@  discard block
 block discarded – undo
192 192
         // Attempt the request
193 193
         try {
194 194
             return match($method) {
195
-                'get'    => $this->client->get($endpoint),    /** @phpstan-ignore-line **/
196
-                'post'   => $this->client->post($endpoint),   /** @phpstan-ignore-line **/
197
-                'put'    => $this->client->put($endpoint),    /** @phpstan-ignore-line **/
195
+                'get'    => $this->client->get($endpoint), /** @phpstan-ignore-line **/
196
+                'post'   => $this->client->post($endpoint), /** @phpstan-ignore-line **/
197
+                'put'    => $this->client->put($endpoint), /** @phpstan-ignore-line **/
198 198
                 'delete' => $this->client->delete($endpoint), /** @phpstan-ignore-line **/
199 199
                 default  => $this->client->get($endpoint)     /** @phpstan-ignore-line **/
200 200
             };
@@ -429,29 +429,29 @@  discard block
 block discarded – undo
429 429
     protected function endpointParameters(string $endpoint, string $subset): array
430 430
     {
431 431
         static $projectParameters = [
432
-            'contributors'           => ['format' => ':platform/:name/contributors'          , 'options' => ['platform', 'name']],
433
-            'dependencies'           => ['format' => ':platform/:name/:version/dependencies' , 'options' => ['platform', 'name', 'version']],
432
+            'contributors'           => ['format' => ':platform/:name/contributors', 'options' => ['platform', 'name']],
433
+            'dependencies'           => ['format' => ':platform/:name/:version/dependencies', 'options' => ['platform', 'name', 'version']],
434 434
             'dependent_repositories' => ['format' => ':platform/:name/dependent_repositories', 'options' => ['platform', 'name']],
435
-            'dependents'             => ['format' => ':platform/:name/dependents'            , 'options' => ['platform', 'name']],
436
-            'search'                 => ['format' => 'search'                                , 'options' => ['query', 'sort']],
437
-            'sourcerank'             => ['format' => ':platform/:name/sourcerank'            , 'options' => ['platform', 'name']],
438
-            'project'                => ['format' => ':platform/:name'                       , 'options' => ['platform', 'name']]
435
+            'dependents'             => ['format' => ':platform/:name/dependents', 'options' => ['platform', 'name']],
436
+            'search'                 => ['format' => 'search', 'options' => ['query', 'sort']],
437
+            'sourcerank'             => ['format' => ':platform/:name/sourcerank', 'options' => ['platform', 'name']],
438
+            'project'                => ['format' => ':platform/:name', 'options' => ['platform', 'name']]
439 439
         ];
440 440
 
441 441
         static $repositoryParameters = [
442 442
             'dependencies' => ['format' => 'github/:owner/:name/dependencies', 'options' => ['owner', 'name']],
443
-            'projects'     => ['format' => 'github/:owner/:name/projects'    , 'options' => ['owner', 'name']],
444
-            'repository'   => ['format' => 'github/:owner/:name'             , 'options' => ['owner', 'name']]
443
+            'projects'     => ['format' => 'github/:owner/:name/projects', 'options' => ['owner', 'name']],
444
+            'repository'   => ['format' => 'github/:owner/:name', 'options' => ['owner', 'name']]
445 445
         ];
446 446
 
447 447
         static $userParameters = [
448
-            'dependencies'             => ['format' => 'github/:login/dependencies'            , 'options' => ['login']],
449
-            'package_contributions'    => ['format' => 'github/:login/project-contributions'   , 'options' => ['login']],
450
-            'packages'                 => ['format' => 'github/:login/projects'                , 'options' => ['login']],
451
-            'repositories'             => ['format' => 'github/:login/repositories'            , 'options' => ['login']],
448
+            'dependencies'             => ['format' => 'github/:login/dependencies', 'options' => ['login']],
449
+            'package_contributions'    => ['format' => 'github/:login/project-contributions', 'options' => ['login']],
450
+            'packages'                 => ['format' => 'github/:login/projects', 'options' => ['login']],
451
+            'repositories'             => ['format' => 'github/:login/repositories', 'options' => ['login']],
452 452
             'repository_contributions' => ['format' => 'github/:login/repository-contributions', 'options' => ['login']],
453
-            'subscriptions'            => ['format' => 'subscriptions'                         , 'options' => []],
454
-            'user'                     => ['format' => 'github/:login'                         , 'options' => ['login']]
453
+            'subscriptions'            => ['format' => 'subscriptions', 'options' => []],
454
+            'user'                     => ['format' => 'github/:login', 'options' => ['login']]
455 455
         ];
456 456
 
457 457
         static $subscriptionParameters = [
Please login to merge, or discard this patch.
tests/src/LibrariesIOTest.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -186,14 +186,14 @@  discard block
 block discarded – undo
186 186
     public static function dataProjectProvider(): array
187 187
     {
188 188
         return [
189
-            ['{"Hello":"World"}', 'contributors'          , ['platform' => 'npm'  , 'name' => 'utility']],
190
-            ['{"Hello":"World"}', 'dependencies'          , ['platform' => 'npm'  , 'name' => 'utility', 'version' => 'latest']],
191
-            ['{"Hello":"World"}', 'dependent_repositories', ['platform' => 'npm'  , 'name' => 'utility']],
192
-            ['{"Hello":"World"}', 'dependents'            , ['platform' => 'npm'  , 'name' => 'utility']],
193
-            ['{"Hello":"World"}', 'search'                , ['query'    => 'grunt', 'sort' => 'rank', 'keywords' => 'wordpress']],
194
-            ['{"Hello":"World"}', 'search'                , ['query'    => 'grunt', 'sort' => 'notvalid', 'keywords' => 'wordpress']],
195
-            ['{"Hello":"World"}', 'sourcerank'            , ['platform' => 'npm'  , 'name' => 'utility']],
196
-            ['{"Hello":"World"}', 'project'               , ['platform' => 'npm'  , 'name' => 'utility', 'page' => 1, 'per_page' => 30]]
189
+            ['{"Hello":"World"}', 'contributors', ['platform' => 'npm', 'name' => 'utility']],
190
+            ['{"Hello":"World"}', 'dependencies', ['platform' => 'npm', 'name' => 'utility', 'version' => 'latest']],
191
+            ['{"Hello":"World"}', 'dependent_repositories', ['platform' => 'npm', 'name' => 'utility']],
192
+            ['{"Hello":"World"}', 'dependents', ['platform' => 'npm', 'name' => 'utility']],
193
+            ['{"Hello":"World"}', 'search', ['query'    => 'grunt', 'sort' => 'rank', 'keywords' => 'wordpress']],
194
+            ['{"Hello":"World"}', 'search', ['query'    => 'grunt', 'sort' => 'notvalid', 'keywords' => 'wordpress']],
195
+            ['{"Hello":"World"}', 'sourcerank', ['platform' => 'npm', 'name' => 'utility']],
196
+            ['{"Hello":"World"}', 'project', ['platform' => 'npm', 'name' => 'utility', 'page' => 1, 'per_page' => 30]]
197 197
         ];
198 198
     }
199 199
 
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
     {
221 221
         $this->stub->client = $this->client;
222 222
         $this->expectException(InvalidArgumentException::class);
223
-        $response = $this->stub->project('notvalid', ['platform' => 'npm'  , 'name' => 'utility']);
223
+        $response = $this->stub->project('notvalid', ['platform' => 'npm', 'name' => 'utility']);
224 224
     }
225 225
 
226 226
     /**
@@ -241,12 +241,12 @@  discard block
 block discarded – undo
241 241
     public static function dataRepositoryProvider(): array
242 242
     {
243 243
         return [
244
-            ['{"Hello":"World"}', 'dependencies' , ['owner' => 'ericsizemore', 'name' => 'utility']],
245
-            ['{"Hello":"World"}', 'projects'     , ['owner' => 'ericsizemore', 'name' => 'utility']],
246
-            ['{"Hello":"World"}', 'repository'   , ['owner' => 'ericsizemore', 'name' => 'utility']],
247
-            ['{"Hello":"World"}', 'dependencies' , ['owner' => 'ericsizemore', 'name' => 'utility']],
248
-            ['{"Hello":"World"}', 'projects'     , ['owner' => 'ericsizemore', 'name' => 'utility', 'page' => 1, 'per_page' => 30]],
249
-            ['{"Hello":"World"}', 'repository'   , ['owner' => 'ericsizemore', 'name' => 'utility']],
244
+            ['{"Hello":"World"}', 'dependencies', ['owner' => 'ericsizemore', 'name' => 'utility']],
245
+            ['{"Hello":"World"}', 'projects', ['owner' => 'ericsizemore', 'name' => 'utility']],
246
+            ['{"Hello":"World"}', 'repository', ['owner' => 'ericsizemore', 'name' => 'utility']],
247
+            ['{"Hello":"World"}', 'dependencies', ['owner' => 'ericsizemore', 'name' => 'utility']],
248
+            ['{"Hello":"World"}', 'projects', ['owner' => 'ericsizemore', 'name' => 'utility', 'page' => 1, 'per_page' => 30]],
249
+            ['{"Hello":"World"}', 'repository', ['owner' => 'ericsizemore', 'name' => 'utility']],
250 250
         ];
251 251
     }
252 252
 
@@ -294,12 +294,12 @@  discard block
 block discarded – undo
294 294
     public static function dataUserProvider(): array
295 295
     {
296 296
         return [
297
-            ['{"Hello":"World"}', 'dependencies'            , ['login' => 'ericsizemore']],
298
-            ['{"Hello":"World"}', 'package_contributions'   , ['login' => 'ericsizemore']],
299
-            ['{"Hello":"World"}', 'packages'                , ['login' => 'ericsizemore']],
300
-            ['{"Hello":"World"}', 'repositories'            , ['login' => 'ericsizemore']],
297
+            ['{"Hello":"World"}', 'dependencies', ['login' => 'ericsizemore']],
298
+            ['{"Hello":"World"}', 'package_contributions', ['login' => 'ericsizemore']],
299
+            ['{"Hello":"World"}', 'packages', ['login' => 'ericsizemore']],
300
+            ['{"Hello":"World"}', 'repositories', ['login' => 'ericsizemore']],
301 301
             ['{"Hello":"World"}', 'repository_contributions', ['login' => 'ericsizemore', 'page' => 1, 'per_page' => 30]],
302
-            ['{"Hello":"World"}', 'subscriptions'           , []]
302
+            ['{"Hello":"World"}', 'subscriptions', []]
303 303
         ];
304 304
     }
305 305
 
@@ -347,9 +347,9 @@  discard block
 block discarded – undo
347 347
     public static function dataSubscriptionProvider(): array
348 348
     {
349 349
         return [
350
-            ['{"Hello":"World"}', 'subscribe'  , ['platform' => 'npm', 'name' => 'utility', 'include_prerelease' => 'true']],
351
-            ['{"Hello":"World"}', 'check'      , ['platform' => 'npm', 'name' => 'utility']],
352
-            ['{"Hello":"World"}', 'update'     , ['platform' => 'npm', 'name' => 'utility', 'include_prerelease' => 'false']],
350
+            ['{"Hello":"World"}', 'subscribe', ['platform' => 'npm', 'name' => 'utility', 'include_prerelease' => 'true']],
351
+            ['{"Hello":"World"}', 'check', ['platform' => 'npm', 'name' => 'utility']],
352
+            ['{"Hello":"World"}', 'update', ['platform' => 'npm', 'name' => 'utility', 'include_prerelease' => 'false']],
353 353
             ['{"Hello":"World"}', 'unsubscribe', ['platform' => 'npm', 'name' => 'utility']]
354 354
         ];
355 355
     }
Please login to merge, or discard this patch.