Completed
Push — development ( e2df92...98c85a )
by Claudio
02:28
created

ImagingController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 29
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getUserHead() 0 7 2
A getUserBody() 0 4 1
1
<?php
2
3
namespace App\Http\Controllers;
4
5
use App\Models\User;
6
use Illuminate\Http\Request;
7
use Illuminate\Support\Facades\Config;
8
use Laravel\Lumen\Http\Redirector;
9
use Laravel\Lumen\Routing\Controller as BaseController;
10
11
/**
12
 * Class ImagingController
13
 * @package App\Http\Controllers
14
 */
15
class ImagingController extends BaseController
16
{
17
    /**
18
     * Get User Figure for Big Header
19
     * based on User Name or Figure
20
     *
21
     * @param Request $request
22
     * @return Redirector
23
     */
24
    public function getUserHead(Request $request)
25
    {
26
        return redirect(Config::get('chocolatey.imaging') . 'avatarimage?figure='
0 ignored issues
show
Bug Compatibility introduced by
The expression redirect(\Illuminate\Sup... '&size=l&headonly=1'); of type Laravel\Lumen\Http\Redir...e\Http\RedirectResponse adds the type Illuminate\Http\RedirectResponse to the return on line 26 which is incompatible with the return type documented by App\Http\Controllers\Ima...Controller::getUserHead of type Laravel\Lumen\Http\Redirector.
Loading history...
27
            . ($request->has('figure') ? $request->input('figure') :
28
                User::where('username', $request->input('user'))->first()->figureString)
29
            . '&size=l&headonly=1');
30
    }
31
32
    /**
33
     * Get User Figure for Body
34
     * based on User Figure
35
     *
36
     * @param string $figure
37
     * @return Redirector
38
     */
39
    public function getUserBody(string $figure)
40
    {
41
        return redirect(Config::get('chocolatey.imaging') . "avatar/{$figure}");
0 ignored issues
show
Bug Compatibility introduced by
The expression redirect(\Illuminate\Sup... . "avatar/{$figure}"); of type Laravel\Lumen\Http\Redir...e\Http\RedirectResponse adds the type Illuminate\Http\RedirectResponse to the return on line 41 which is incompatible with the return type documented by App\Http\Controllers\Ima...Controller::getUserBody of type Laravel\Lumen\Http\Redirector.
Loading history...
42
    }
43
}
44