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

GalleryClientAPIController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 3
dl 0
loc 22
rs 10
c 1
b 0
f 1
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A show() 0 3 1
A index() 0 3 1
1
<?php
2
3
namespace Adminetic\Website\Http\Controllers\API\Client;
4
5
use Adminetic\Website\Models\Admin\Gallery;
6
use Adminetic\Website\Http\Resources\Gallery\GalleryCollection;
7
use Adminetic\Website\Http\Resources\Gallery\GalleryResource;
8
use App\Http\Controllers\Controller;
9
use Illuminate\Http\Request;
10
11
class GalleryClientAPIController 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 GalleryCollection(Gallery::all());
0 ignored issues
show
Bug Best Practice introduced by
The expression return new Adminetic\Web...s\Admin\Gallery::all()) returns the type Adminetic\Website\Http\R...llery\GalleryCollection 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\Gallery  $gallery
0 ignored issues
show
Bug introduced by
The type Adminetic\Website\Http\C...te\Models\Admin\Gallery was not found. Did you mean Adminetic\Website\Models\Admin\Gallery? If so, make sure to prefix the type with \.
Loading history...
28
     * @return \Illuminate\Http\Response
29
     */
30
    public function show(Gallery $gallery)
31
    {
32
        return new GalleryResource($gallery);
0 ignored issues
show
Bug Best Practice introduced by
The expression return new Adminetic\Web...lleryResource($gallery) returns the type Adminetic\Website\Http\R...Gallery\GalleryResource which is incompatible with the documented return type Illuminate\Http\Response.
Loading history...
33
    }
34
}
35