Completed
Push — task/enable_typescript ( cd73af )
by Tristan
10:06
created

DemoController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
eloc 10
dl 0
loc 22
ccs 0
cts 10
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A reviewApplications() 0 15 1
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace App\Http\Controllers;
4
5
use Illuminate\Support\Facades\Lang;
6
use App\Models\JobPoster;
7
use App\Models\JobApplication;
8
9
class DemoController extends Controller
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class DemoController
Loading history...
10
{
11
    /**
12
     * Display a listing of the applicants to specified job.
13
     *
14
     * @return \Illuminate\Http\Response
15
     */
16
    public function reviewApplications()
17
    {
18
        $jobPoster = factory(JobPoster::class)->state('closed')->create();
19
        $applications = factory(JobApplication::class, 10)->create([
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
20
            'job_poster_id' => $jobPoster->id
21
        ]);
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
22
        $jobPoster->job_applications()->saveMany($applications);
23
        $applications->load(['veteran_status', 'citizenship_declaration']);
24
        return view('manager/review_applications', [
1 ignored issue
show
Bug Best Practice introduced by
The expression return view('manager/rev...ons' => $applications)) returns the type Illuminate\View\View which is incompatible with the documented return type Illuminate\Http\Response.
Loading history...
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
25
            /*Localization Strings*/
26
            'jobs_l10n' => Lang::get('manager/job_index'),
27
28
            /* Data */
29
            'job' => $jobPoster,
30
            'applications' => $applications,
31
        ]);
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
32
    }
33
}
34