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

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