Completed
Pull Request — master (#25)
by Karl
05:00
created

CollectionsController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 5
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A download() 0 8 1
1
<?php namespace JobApis\JobsToMail\Http\Controllers;
2
3
use Illuminate\Foundation\Bus\DispatchesJobs;
4
use Illuminate\Http\Request;
5
use Illuminate\Routing\Controller as BaseController;
6
use Illuminate\Foundation\Validation\ValidatesRequests;
7
use JobApis\JobsToMail\Jobs\Collections\GenerateCsv;
8
9
class CollectionsController extends BaseController
10
{
11
    use DispatchesJobs, ValidatesRequests;
12
13
    /**
14
     * Download jobs from a collection by ID
15
     */
16
    public function download(Request $request, $id)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
17
    {
18
        $path = $this->dispatchNow(new GenerateCsv($id));
19
20
        // sleep(2);
21
22
        return response()->download($path, null, ['Content-Type: text/csv']);
23
    }
24
}
25