1 | <?php |
||||
2 | |||||
3 | namespace Laravel\DataTables\Traits; |
||||
4 | |||||
5 | trait Deletable |
||||
6 | { |
||||
7 | /** |
||||
8 | * Allow Entity Deleting. |
||||
9 | * |
||||
10 | * @var bool |
||||
11 | */ |
||||
12 | public $allowDeleting = false; |
||||
13 | |||||
14 | /** |
||||
15 | * @param Model $result |
||||
0 ignored issues
–
show
|
|||||
16 | * @param Request $request |
||||
0 ignored issues
–
show
|
|||||
17 | * @return bool|null |
||||
18 | */ |
||||
19 | public function destroy($ids): ?bool |
||||
20 | { |
||||
21 | $ids = (array) $ids; |
||||
22 | if (! $this->allowDeleting) { |
||||
23 | return null; |
||||
24 | } |
||||
25 | |||||
26 | return $this->builder()->whereIn( |
||||
0 ignored issues
–
show
It seems like
builder() 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
![]() |
|||||
27 | $this->builder()->getModel()->getQualifiedKeyName(), |
||||
28 | $ids |
||||
29 | )->delete(); |
||||
30 | } |
||||
31 | } |
||||
32 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths