Code Duplication    Length = 6-6 lines in 2 locations

src/Strategy/GithubStrategy.php 1 location

@@ 101-106 (lines=6) @@
98
        $package = json_decode(humbug_get_contents($packageUrl), true);
99
        restore_error_handler();
100
101
        if (null === $package || json_last_error() !== JSON_ERROR_NONE) {
102
            throw new JsonParsingException(
103
                'Error parsing JSON package data'
104
                . (function_exists('json_last_error_msg') ? ': ' . json_last_error_msg() : '')
105
            );
106
        }
107
108
        $versions = array_keys($package['package']['versions']);
109
        $versionParser = new VersionParser($versions);

src/Strategy/ManifestStrategy.php 1 location

@@ 356-361 (lines=6) @@
353
            }
354
355
            $this->manifest = json_decode($manifestContents, true, 512, JSON_OBJECT_AS_ARRAY);
356
            if (json_last_error() !== JSON_ERROR_NONE) {
357
                throw new JsonParsingException(
358
                    'Error parsing manifest file'
359
                    . (function_exists('json_last_error_msg') ? ': ' . json_last_error_msg() : '')
360
                );
361
            }
362
        }
363
364
        return $this->manifest;