Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

Commit 5bfc2cb

Browse files
committed
Улучшения
1 parent 6de2c54 commit 5bfc2cb

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

module/ggrachdev.debugbar/classes/general/Filtrator/Filtrator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ class Filtrator implements FiltratorContract {
1515
'limit', 'first', 'last', 'keys'
1616
];
1717

18-
protected array $filters;
18+
protected array $sequenceFilters;
1919

2020
public function addFilter(string $filterType, array $filterParams = []): void {
2121
if ($this->hasFilter($filterType)) {
22-
$this->filters[] = [
22+
$this->sequenceFilters[] = [
2323
'type' => $filterType,
2424
'params' => $filterParams
2525
];
@@ -65,11 +65,11 @@ protected function filtrateItem(string $filterType, array $filterParams, $data)
6565
}
6666

6767
public function clearFilters(): void {
68-
$this->filters = [];
68+
$this->sequenceFilters = [];
6969
}
7070

7171
public function filtrate($data) {
72-
if (!empty($this->filters)) {
72+
if (!empty($this->filters) && !empty($data)) {
7373
foreach ($this->filters as $arFilter) {
7474
$data = $this->filtrateItem($arFilter['type'], $arFilter['params'], $data);
7575
}

module/ggrachdev.debugbar/classes/general/Filtrator/structure.puml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
class Filtrator {
1414
# const array FILTERS_NAME
15-
# array $filters
15+
# array $sequenceFilters
1616

1717
+ mixed filtrate(mixed $data)
1818
# array filtrateItem(string $filterType, array $filterParams, mixed $data): mixed

module/ggrachdev.debugbar/include.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@
7777
$GLOBALS["DD"]->getConfiguratorDebugger()->setShowModes(['debug_bar']);
7878

7979
function DD(...$data) {
80+
81+
$GLOBALS["DD"]->resetFilter();
82+
8083
if (!empty($data)) {
8184
foreach ($data as $item) {
8285
$GLOBALS["DD"]->notice($item);

0 commit comments

Comments
 (0)