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.

FilesystemDestination   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 24
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A clean() 0 8 2
A write() 0 4 1
1
<?php
2
3
namespace Spatie\Export\Destinations;
4
5
use Illuminate\Contracts\Filesystem\Filesystem;
6
use Spatie\Export\Destination;
7
8
class FilesystemDestination implements Destination
9
{
10
    /** @var \Illuminate\Contracts\Filesystem */
11
    protected $filesystem;
12
13
    public function __construct(Filesystem $filesystem)
14
    {
15
        $this->filesystem = $filesystem;
0 ignored issues
show
Documentation Bug introduced by
It seems like $filesystem of type object<Illuminate\Contra...\Filesystem\Filesystem> is incompatible with the declared type object<Illuminate\Contracts\Filesystem> of property $filesystem.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
16
    }
17
18
    public function clean()
19
    {
20
        $this->filesystem->delete($this->filesystem->files());
21
22
        foreach ($this->filesystem->directories() as $directory) {
23
            $this->filesystem->deleteDirectory($directory);
24
        }
25
    }
26
27
    public function write(string $path, string $contents)
28
    {
29
        $this->filesystem->put($path, $contents);
30
    }
31
}
32