Code Duplication    Length = 12-12 lines in 2 locations

src/Configuration/Loader/Json.php 2 locations

@@ 263-274 (lines=12) @@
260
     * @param  array                           $json
261
     * @throws \phpbu\App\Exception
262
     */
263
    protected function setCrypt(Configuration\Backup $backup, array $json)
264
    {
265
        if (isset($json['crypt'])) {
266
            if (!isset($json['crypt']['type'])) {
267
                throw new Exception('invalid crypt configuration: type missing');
268
            }
269
            $type    = $json['crypt']['type'];
270
            $skip    = Arr::getValue($json['crypt'], 'skipOnFailure', true);
271
            $options = $this->getOptions($json['crypt']);
272
            $backup->setCrypt(new Configuration\Backup\Crypt($type, $skip, $options));
273
        }
274
    }
275
276
    /**
277
     * Set backup sync configurations.
@@ 305-316 (lines=12) @@
302
     * @param  array                           $json
303
     * @throws \phpbu\App\Exception
304
     */
305
    protected function setCleanup(Configuration\Backup $backup, array $json)
306
    {
307
        if (isset($json['cleanup'])) {
308
            if (!isset($json['cleanup']['type'])) {
309
                throw new Exception('invalid cleanup configuration: type missing');
310
            }
311
            $type    = $json['cleanup']['type'];
312
            $skip    = Arr::getValue($json['cleanup'], 'skipOnFailure', true);
313
            $options = $this->getOptions($json['cleanup']);
314
            $backup->setCleanup(new Configuration\Backup\Cleanup($type, $skip, $options));
315
        }
316
    }
317
318
    /**
319
     * Extracts all option tags.