Code Duplication    Length = 12-12 lines in 2 locations

src/Config/ConfigFileStorage.php 1 location

@@ 158-169 (lines=12) @@
155
        }
156
    }
157
158
    private function encode(stdClass $jsonData, $path)
159
    {
160
        try {
161
            return $this->jsonEncoder->encode($jsonData);
162
        } catch (EncodingFailedException $e) {
163
            throw new InvalidConfigException(sprintf(
164
                'The configuration in %s could not be encoded: %s',
165
                $path,
166
                $e->getMessage()
167
            ), 0, $e);
168
        }
169
    }
170
171
    private function decode($json, $path)
172
    {

src/Package/PackageFileStorage.php 1 location

@@ 233-244 (lines=12) @@
230
        }
231
    }
232
233
    private function encode(stdClass $jsonData, $path)
234
    {
235
        try {
236
            return $this->jsonEncoder->encode($jsonData);
237
        } catch (EncodingFailedException $e) {
238
            throw new InvalidConfigException(sprintf(
239
                'The configuration in %s could not be encoded: %s',
240
                $path,
241
                $e->getMessage()
242
            ), 0, $e);
243
        }
244
    }
245
246
    private function decode($json, $path)
247
    {