RespondWithViewJob   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 18
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 3 1
A __construct() 0 6 1
1
<?php
2
3
namespace Anfischer\Foundation\Domains\Http\Jobs;
4
5
use Anfischer\Foundation\Job\Job;
6
use Illuminate\Contracts\Routing\ResponseFactory;
7
use Illuminate\Http\Response;
8
9
class RespondWithViewJob extends Job
10
{
11
    protected $status;
12
    protected $data;
13
    protected $headers;
14
    protected $template;
15
16 4
    public function __construct(string $template, array $data = [], int $status = 200, array $headers = [])
17
    {
18 4
        $this->template = $template;
19 4
        $this->data = $data;
20 4
        $this->status = $status;
21 4
        $this->headers = $headers;
22 4
    }
23
24 4
    public function handle(ResponseFactory $factory) : Response
25
    {
26 4
        return $factory->view($this->template, $this->data, $this->status, $this->headers);
27
    }
28
}
29