Completed
Push — master ( f1dd04...77e978 )
by Beñat
01:46
created

ByHashUploadController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A uploadAction() 0 10 1
1
<?php
2
3
/*
4
 * This file is part of the BenGorFile package.
5
 *
6
 * (c) Beñat Espiña <[email protected]>
7
 * (c) Gorka Laucirica <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace BenGorFile\FileBundle\Controller\Api;
14
15
use BenGorFile\FileBundle\Controller\ByHashUploadAction;
16
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
17
use Symfony\Component\HttpFoundation\JsonResponse;
18
use Symfony\Component\HttpFoundation\Request;
19
20
/**
21
 * @author Beñat Espiña <[email protected]>
22
 */
23
class ByHashUploadController extends Controller
24
{
25
    use ByHashUploadAction;
26
27
    public function uploadAction(Request $request, $fileClass)
28
    {
29
        return new JsonResponse(
30
            $this->upload(
31
                $request,
32
                $this->get('bengor_file.' . $fileClass . '.command_bus'),
33
                $fileClass
34
            )
35
        );
36
    }
37
}
38