Issues (22)

src/Traits/Processors/Deletable.php (5 issues)

Labels
Severity
1
<?php
2
3
namespace Helldar\LaravelLangPublisher\Traits\Processors;
4
5
use Helldar\LaravelLangPublisher\Constants\Status;
6
use Illuminate\Support\Facades\File as IlluminateFile;
7
8
trait Deletable
9 24
{
10
    public function run(): array
11
    {
12
        $this->delete()
13 24
            ? $this->push('*', Status::DELETED)
0 ignored issues
show
It seems like push() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

13
            ? $this->/** @scrutinizer ignore-call */ push('*', Status::DELETED)
Loading history...
14 12
            : $this->push('*', Status::SKIPPED);
15 12
16
        return $this->result();
0 ignored issues
show
It seems like result() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

16
        return $this->/** @scrutinizer ignore-call */ result();
Loading history...
17 24
    }
18
19
    protected function delete(): bool
20
    {
21
        if ($this->isProtected()) {
0 ignored issues
show
It seems like isProtected() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

21
        if ($this->/** @scrutinizer ignore-call */ isProtected()) {
Loading history...
22
            return false;
23
        }
24
25
        return $this->wantsJson()
0 ignored issues
show
It seems like wantsJson() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

25
        return $this->/** @scrutinizer ignore-call */ wantsJson()
Loading history...
26
            ? IlluminateFile::delete($this->targetPath())
0 ignored issues
show
It seems like targetPath() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

26
            ? IlluminateFile::delete($this->/** @scrutinizer ignore-call */ targetPath())
Loading history...
27
            : IlluminateFile::deleteDirectory($this->targetPath());
28
    }
29
}
30