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

TestimonialClientAPIController::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\Testimonial;
6
use Adminetic\Website\Http\Resources\Testimonial\TestimonialCollection;
7
use Adminetic\Website\Http\Resources\Testimonial\TestimonialResource;
8
use App\Http\Controllers\Controller;
9
use Illuminate\Http\Request;
10
11
class TestimonialClientAPIController 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 TestimonialCollection(Testimonial::all());
0 ignored issues
show
Bug Best Practice introduced by
The expression return new Adminetic\Web...min\Testimonial::all()) returns the type Adminetic\Website\Http\R...l\TestimonialCollection 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\Testimonial  $testimonial
0 ignored issues
show
Bug introduced by
The type Adminetic\Website\Http\C...odels\Admin\Testimonial was not found. Did you mean Adminetic\Website\Models\Admin\Testimonial? If so, make sure to prefix the type with \.
Loading history...
28
     * @return \Illuminate\Http\Response
29
     */
30
    public function show(Testimonial $testimonial)
31
    {
32
        return new TestimonialResource($testimonial);
0 ignored issues
show
Bug Best Practice introduced by
The expression return new Adminetic\Web...lResource($testimonial) returns the type Adminetic\Website\Http\R...ial\TestimonialResource which is incompatible with the documented return type Illuminate\Http\Response.
Loading history...
33
    }
34
}
35