SkillDeclarationController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 15
c 0
b 0
f 0
dl 0
loc 40
ccs 0
cts 9
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A editAuthenticated() 0 4 1
A edit() 0 18 1
1
<?php
2
3
namespace App\Http\Controllers;
4
5
use Illuminate\Support\Facades\Lang;
6
use Illuminate\Http\Request;
7
use App\Models\Applicant;
8
use App\Http\Controllers\Controller;
9
10
class SkillDeclarationController extends Controller
11
{
12
13
    /**
14
     * Show the form for editing the logged-in applicant's skills
15
     *
16
     * @param  \Illuminate\Http\Request $request Incoming request.
17
     * @return \Illuminate\Http\Response
18
     */
19
    public function editAuthenticated(Request $request)
20
    {
21
        $applicant = $request->user()->applicant;
22
        return redirect(route('profile.skills-old.edit', $applicant));
0 ignored issues
show
Bug introduced by
The function redirect was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

22
        return /** @scrutinizer ignore-call */ redirect(route('profile.skills-old.edit', $applicant));
Loading history...
Bug introduced by
The function route was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

22
        return redirect(/** @scrutinizer ignore-call */ route('profile.skills-old.edit', $applicant));
Loading history...
23
    }
24
25
    /**
26
     * Show the form for editing the applicant's skills
27
     *
28
     * @param  \Illuminate\Http\Request $request   Incoming request object.
29
     * @param  \App\Models\Applicant    $applicant Applicant object.
30
     * @return \Illuminate\Http\Response
31
     */
32
    public function edit(Request $request, Applicant $applicant)
33
    {
34
        $custom_breadcrumbs = [
35
            'home' => route('home'),
0 ignored issues
show
Bug introduced by
The function route was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

35
            'home' => /** @scrutinizer ignore-call */ route('home'),
Loading history...
36
            'profile' => '',
37
        ];
38
39
        $applicant->load([
40
            'skill_declarations.skill.skill_type',
41
            'skill_declarations.skill_status',
42
            'skill_declarations.skill_level',
43
        ]);
44
45
        return view('applicant/profile_03_skills', [
0 ignored issues
show
Bug introduced by
The function view was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

45
        return /** @scrutinizer ignore-call */ view('applicant/profile_03_skills', [
Loading history...
46
            'applicant' => $applicant,
47
            'profile' => Lang::get('applicant/profile_skills'),
48
            'skills_modals' => Lang::get('common/skills_modals'),
49
            'custom_breadcrumbs' => $custom_breadcrumbs,
50
        ]);
51
    }
52
}
53