Completed
Push — master ( 5ab18c...4e82e1 )
by claudio
08:39
created

NoAuthController::showImage()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 12
ccs 0
cts 11
cp 0
rs 9.4285
cc 2
eloc 9
nc 2
nop 1
crap 6
1
<?php
2
3
namespace plunner\Http\Controllers;
4
5
use Illuminate\Http\Request;
6
use plunner\Http\Requests;
7
8
class NoAuthController extends Controller
9
{
10
    public function __construct()
11
    {
12
    }
13
14
15
    //TODO remove this, it is just a tmp fix
16
    /**
17
     *
18
     * Store a newly created resource in storage.
19
     *
20
     * @param int $meetingId
21
     * @return static
22
     */
23
    public function showImage($meetingId)
24
    {
25
        $meeting = Group::findOrFail($meetingId);
26
        //$this->authorize($meeting);
27
        $ret = self::getImg($meeting);
0 ignored issues
show
Bug introduced by
The method getImg() does not seem to exist on object<plunner\Http\Controllers\NoAuthController>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
28
        $blank = storage_path('img/meetings.jpg');
29
        if ($ret === false)
30
            return (new Response(file_get_contents($blank), 200))
31
                ->header('Content-Type', 'image/jpeg');
32
        return (new Response($ret, 200))
33
            ->header('Content-Type', 'image/jpeg');
34
    }
35
36
}
37