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
Bug
introduced
by
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
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
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
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
Loading history...
|
|||||
27 | : IlluminateFile::deleteDirectory($this->targetPath()); |
||||
28 | } |
||||
29 | } |
||||
30 |