Passed
Push — main ( 2e9e01...1bac82 )
by PRATIK
15:02
created

ProjectClientAPIController::index()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 1
1
<?php
2
3
namespace Adminetic\Website\Http\Controllers\API\Client;
4
5
use Adminetic\Website\Models\Admin\Project;
6
use Adminetic\Website\Http\Resources\Project\ProjectCollection;
7
use Adminetic\Website\Http\Resources\Project\ProjectResource;
8
use App\Http\Controllers\Controller;
9
use Illuminate\Http\Request;
10
11
class ProjectClientAPIController extends Controller
12
{
13
14
    /**
15
     * Display a listing of the resource.
16
     *
17
     * @return \Illuminate\Http\Response
18
     */
19
    public function index()
20
    {
21
        return new ProjectCollection(Project::all());
0 ignored issues
show
Bug Best Practice introduced by
The expression return new Adminetic\Web...s\Admin\Project::all()) returns the type Adminetic\Website\Http\R...oject\ProjectCollection which is incompatible with the documented return type Illuminate\Http\Response.
Loading history...
22
    }
23
24
    /**
25
     * Display the specified resource.
26
     *
27
     * @param  Adminetic\Website\Models\Admin\Project  $project
0 ignored issues
show
Bug introduced by
The type Adminetic\Website\Http\C...te\Models\Admin\Project was not found. Did you mean Adminetic\Website\Models\Admin\Project? If so, make sure to prefix the type with \.
Loading history...
28
     * @return \Illuminate\Http\Response
29
     */
30
    public function show(Project $project)
31
    {
32
        return new ProjectResource($project);
0 ignored issues
show
Bug Best Practice introduced by
The expression return new Adminetic\Web...ojectResource($project) returns the type Adminetic\Website\Http\R...Project\ProjectResource which is incompatible with the documented return type Illuminate\Http\Response.
Loading history...
33
    }
34
}
35