Code Duplication    Length = 6-6 lines in 2 locations

src/Strategy/GithubStrategy.php 1 location

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

src/Strategy/ManifestStrategy.php 1 location

@@ 186-191 (lines=6) @@
183
            }
184
185
            $this->manifest = json_decode($manifestContents, true, 512, JSON_OBJECT_AS_ARRAY);
186
            if (json_last_error() !== JSON_ERROR_NONE) {
187
                throw new JsonParsingException(
188
                    'Error parsing manifest file'
189
                    . (function_exists('json_last_error_msg') ? ': ' . json_last_error_msg() : '')
190
                );
191
            }
192
        }
193
194
        return $this->manifest;