Code Duplication    Length = 7-7 lines in 3 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) {

code/GraphQL/UnpublishFileMutationCreator.php 1 location

@@ 54-60 (lines=7) @@
51
            ));
52
        }
53
54
        if(!$file->canUnpublish($context['currentUser'])) {
55
            throw new \InvalidArgumentException(sprintf(
56
                '%s#%s unpublish not allowed',
57
                File::class,
58
                $args['id']
59
            ));
60
        }
61
62
        $file->doUnpublish();
63