Code Duplication    Length = 7-7 lines in 2 locations

code/GraphQL/DeleteFileMutationCreator.php 1 location

@@ 51-57 (lines=7) @@
48
            ));
49
        }
50
51
        if (!$file->canArchive($context['currentUser'])) {
52
            throw new \InvalidArgumentException(sprintf(
53
                '%s#%s delete not allowed',
54
                File::class,
55
                $args['id']
56
            ));
57
        }
58
59
        $file->doArchive();
60

code/GraphQL/UpdateFileMutationCreator.php 1 location

@@ 73-79 (lines=7) @@
70
            ));
71
        }
72
73
        if (!$file->canEdit($context['currentUser'])) {
74
            throw new \InvalidArgumentException(sprintf(
75
                '%s#%s update not allowed',
76
                File::class,
77
                $args['id']
78
            ));
79
        }
80
81
        // TODO Use input type (and don't allow setting ID)
82
        foreach ($args['file'] as $name => $val) {