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 ( 1c7f7f...f34d69 )
by Sebastian
04:18
created

Exporter::includeFiles()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Spatie\Export;
4
5
use Spatie\Export\Jobs\CrawlSite;
6
use Illuminate\Contracts\Bus\Dispatcher;
7
use Spatie\Export\Jobs\CleanDestination;
8
use Spatie\Export\Jobs\cleanBeforeExportDestination;
9
10
class Exporter
11
{
12
    /** @var \Illuminate\Contracts\Bus\Dispatcher */
13
    protected $dispatcher;
14
15
    /** @var boolean */
16
    protected $cleanBeforeExport = false;
17
18
    /** @var boolean */
19
    protected $crawl = false;
20
21
    /** @var string[] */
22
    protected $paths = [];
23
24
    /** @var string[] */
25
    protected $rewriteRules = [];
26
27
    /** @var string[] */
28
    protected $includeFiles = [];
29
30
    /** @var string[] */
31
    protected $excludeFilePatterns = [];
32
33
    public function __construct(Dispatcher $dispatcher)
34
    {
35
        $this->dispatcher = $dispatcher;
36
    }
37
38
    public function cleanBeforeExport(bool $cleanBeforeExport): self
39
    {
40
        $this->cleanBeforeExport = $cleanBeforeExport;
41
42
        return $this;
43
    }
44
45
    public function crawl(bool $crawl): self
46
    {
47
        $this->crawl = $crawl;
48
49
        return $this;
50
    }
51
52
    public function paths(array $paths): self
53
    {
54
        $this->paths = array_merge($this->paths, $paths);
0 ignored issues
show
Documentation Bug introduced by
It seems like array_merge($this->paths, $paths) of type array is incompatible with the declared type array<integer,string> of property $paths.

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...
55
56
        return $this;
57
    }
58
59
    public function rewriteRules(array $rewriteRules): self
60
    {
61
        $this->rewriteRules = array_merge($this->rewriteRules, $rewriteRules);
0 ignored issues
show
Documentation Bug introduced by
It seems like array_merge($this->rewriteRules, $rewriteRules) of type array is incompatible with the declared type array<integer,string> of property $rewriteRules.

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...
62
63
        return $this;
64
    }
65
66
    public function includeFiles(array $includeFiles): self
67
    {
68
        $this->includeFiles = array_merge($this->includeFiles, $includeFiles);
0 ignored issues
show
Documentation Bug introduced by
It seems like array_merge($this->includeFiles, $includeFiles) of type array is incompatible with the declared type array<integer,string> of property $includeFiles.

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...
69
70
        return $this;
71
    }
72
73
    public function excludeFilePatterns(array $excludeFilePatterns): self
74
    {
75
        $this->excludeFilePatterns = array_merge($this->excludeFilePatterns, $excludeFilePatterns);
0 ignored issues
show
Documentation Bug introduced by
It seems like array_merge($this->exclu..., $excludeFilePatterns) of type array is incompatible with the declared type array<integer,string> of property $excludeFilePatterns.

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...
76
77
        return $this;
78
    }
79
80
    public function export()
81
    {
82
        if ($this->cleanBeforeExport) {
83
            $this->dispatcher->dispatchNow(new CleanDestination());
84
        }
85
86
        if ($this->crawl) {
87
            $this->dispatcher->dispatchNow(new CrawlSite());
88
        }
89
    }
90
}
91