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

DemoController::reviewApplications()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 15
ccs 0
cts 10
cp 0
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
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