GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 79062a...abf9ae )
by Sebastian
03:18
created

ExportPath   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 23
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handle() 0 12 2
1
<?php
2
3
namespace Spatie\Export\Jobs;
4
5
use Illuminate\Http\Request;
6
use Spatie\Export\Destination;
7
use Illuminate\Contracts\Http\Kernel;
8
use RuntimeException;
9
use Spatie\Export\Crawler\LocalClient;
10
11
class ExportPath
12
{
13
    /** @var string */
14
    protected $path;
15
16
    public function __construct(string $path)
17
    {
18
        $this->path = $path;
19
    }
20
21
    public function handle(Kernel $kernel, Destination $destination)
22
    {
23
        $response = $kernel->handle(
24
            Request::create($this->path)
25
        );
26
27
        if ($response->status() !== 200) {
0 ignored issues
show
Bug introduced by
The method status() does not exist on Symfony\Component\HttpFoundation\Response. Did you maybe mean getStatusCode()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
28
            throw new RuntimeException("Path [{$this->path}] returned status code [{$response->status()}]");
0 ignored issues
show
Bug introduced by
The method status() does not exist on Symfony\Component\HttpFoundation\Response. Did you maybe mean getStatusCode()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
29
        }
30
31
        $destination->write($this->path . '/index.html', $response->content());
0 ignored issues
show
Bug introduced by
The method content() does not exist on Symfony\Component\HttpFoundation\Response. Did you maybe mean getContent()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
32
    }
33
}
34