WorkerStub   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 17
ccs 5
cts 5
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A runRequest() 0 9 1
1
<?php
2
3
namespace Cerbero\OctaneTestbench\Stubs;
4
5
use Cerbero\OctaneTestbench\ResponseTestCase;
6
use Illuminate\Http\Request;
7
use Laravel\Octane\RequestContext;
8
use Laravel\Octane\Worker;
9
10
/**
11
 * The worker stub.
12
 *
13
 */
14
class WorkerStub extends Worker
15
{
16
    /**
17
     * Run the given request
18
     *
19
     * @param Request $request
20
     * @return ResponseTestCase
21
     */
22 13
    public function runRequest(Request $request): ResponseTestCase
23
    {
24 13
        $this->app->instance('request', $request);
25
26 13
        $data = $this->client->marshalRequest(new RequestContext(compact('request')));
27
28 13
        $this->handle($data['context']->request, $data['context']);
29
30 13
        return $this->client->response;
0 ignored issues
show
Bug introduced by
Accessing response on the interface Laravel\Octane\Contracts\Client suggest that you code against a concrete implementation. How about adding an instanceof check?
Loading history...
31
    }
32
}
33