Code Duplication    Length = 12-12 lines in 2 locations

src/Configuration/Loader/Json.php 2 locations

@@ 289-300 (lines=12) @@
286
     * @param  array                           $json
287
     * @throws \phpbu\App\Exception
288
     */
289
    protected function setCrypt(Configuration\Backup $backup, array $json)
290
    {
291
        if (isset($json['crypt'])) {
292
            if (!isset($json['crypt']['type'])) {
293
                throw new Exception('invalid crypt configuration: type missing');
294
            }
295
            $type    = $json['crypt']['type'];
296
            $skip    = Arr::getValue($json['crypt'], 'skipOnFailure', true);
297
            $options = $this->getOptions($json['crypt']);
298
            $backup->setCrypt(new Configuration\Backup\Crypt($type, $skip, $options));
299
        }
300
    }
301
302
    /**
303
     * Set backup sync configurations.
@@ 331-342 (lines=12) @@
328
     * @param  array                           $json
329
     * @throws \phpbu\App\Exception
330
     */
331
    protected function setCleanup(Configuration\Backup $backup, array $json)
332
    {
333
        if (isset($json['cleanup'])) {
334
            if (!isset($json['cleanup']['type'])) {
335
                throw new Exception('invalid cleanup configuration: type missing');
336
            }
337
            $type    = $json['cleanup']['type'];
338
            $skip    = Arr::getValue($json['cleanup'], 'skipOnFailure', true);
339
            $options = $this->getOptions($json['cleanup']);
340
            $backup->setCleanup(new Configuration\Backup\Cleanup($type, $skip, $options));
341
        }
342
    }
343
344
    /**
345
     * Extracts all option tags.