Code Duplication    Length = 10-12 lines in 3 locations

src/Chamilo/CoreBundle/Controller/ResourceController.php 3 locations

@@ 96-107 (lines=12) @@
93
     * @param string $file
94
     * @return \Symfony\Component\HttpFoundation\BinaryFileResponse|void
95
     */
96
    public function getDefaultCourseDocumentAction(Application $app, $file)
97
    {
98
        try {
99
            $file = $app['chamilo.filesystem']->get(
100
                'default_course_document/'.$file
101
            );
102
103
            return $app->sendFile($file->getPathname());
104
        } catch (\InvalidArgumentException $e) {
105
            return $app->abort(404, 'File not found');
106
        }
107
    }
108
109
    /**
110
     * @param Application $app
@@ 115-126 (lines=12) @@
112
     * @param $file
113
     * @return \Symfony\Component\HttpFoundation\BinaryFileResponse|void
114
     */
115
    public function getGroupFile(Application $app, $groupId, $file)
116
    {
117
        try {
118
            $file = $app['chamilo.filesystem']->get(
119
                'upload/groups/'.$groupId.'/'.$file
120
            );
121
122
            return $app->sendFile($file->getPathname());
123
        } catch (\InvalidArgumentException $e) {
124
            return $app->abort(404, 'File not found');
125
        }
126
    }
127
128
    /**
129
     * @param Application $app
@@ 133-142 (lines=10) @@
130
     * @param $file
131
     * @return \Symfony\Component\HttpFoundation\BinaryFileResponse|void
132
     */
133
    public function getUserFile(Application $app, $file)
134
    {
135
        try {
136
            $file = $app['chamilo.filesystem']->get('upload/users/'.$file);
137
138
            return $app->sendFile($file->getPathname());
139
        } catch (\InvalidArgumentException $e) {
140
            return $app->abort(404, 'File not found');
141
        }
142
    }
143
}
144