Passed
Push — main ( b96c2d...30a05e )
by Richard
04:40
created

GameController::show()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Furic\GameEssentials\Http\Controllers;
4
5
use Game;
0 ignored issues
show
Bug introduced by
The type Game was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use App\Http\Controllers\Controller;
0 ignored issues
show
Bug introduced by
The type App\Http\Controllers\Controller was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use Illuminate\Http\Request;
8
9
class GameController extends Controller
10
{
11
12
    /**
13
     * Display the specified game resource.
14
     *
15
     * @param  int  $id
16
     * @return \Illuminate\Http\Response
17
     */
18
    public function show($id)
19
    {
20
        return reponse(Game::findOrFail($id), 200);
0 ignored issues
show
Bug introduced by
The function reponse 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

20
        return /** @scrutinizer ignore-call */ reponse(Game::findOrFail($id), 200);
Loading history...
21
    }
22
23
    /**
24
     * Display the versions of a specified game resource.
25
     *
26
     * @param  int  $id
27
     * @return \Illuminate\Http\Response
28
     */
29
    public function showVersions($id) // Depricated
30
    {
31
        $game = Game::findOrFail($id);
32
        return reponse(['ios' => $game->version_ios, 'android' => $game->version_android, 'tvos' => $game->version_tvos], 200);
0 ignored issues
show
Bug introduced by
The function reponse 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

32
        return /** @scrutinizer ignore-call */ reponse(['ios' => $game->version_ios, 'android' => $game->version_android, 'tvos' => $game->version_tvos], 200);
Loading history...
33
    }
34
35
}
36