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

ImagingController::getUserBody()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 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