Passed
Push — master ( 3ee1d1...534f17 )
by Stephen
03:57 queued 58s
created

WithResponse   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 5
c 1
b 0
f 0
dl 0
loc 25
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getResponse() 0 3 1
1
<?php
2
3
namespace Sfneal\Testing\Utils\Traits;
4
5
use Illuminate\Testing\TestResponse;
6
7
trait WithResponse
8
{
9
    /**
10
     * @var string Name of the route
11
     */
12
    protected $routeName;
13
14
    /**
15
     * @var array Params to pass to the route
16
     */
17
    protected $routeParams = [];
18
19
    /**
20
     * @var TestResponse
21
     */
22
    protected $response;
23
24
    /**
25
     * Retrieve a 'GET' response using route & params.
26
     *
27
     * @return TestResponse
28
     */
29
    protected function getResponse(): TestResponse
30
    {
31
        return $this->get(route($this->routeName, $this->routeParams));
0 ignored issues
show
Bug introduced by
It seems like get() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

31
        return $this->/** @scrutinizer ignore-call */ get(route($this->routeName, $this->routeParams));
Loading history...
32
    }
33
}
34