This repository was archived by the owner on Sep 6, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed
ggrachdev.debugbar/classes/general Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ public function __call($name, $arguments) {
3333
3434 if ($ this ->getFiltrator ()->hasFilter ($ name ))
3535 {
36- $ this ->getFiltrator ()->addFilter ($ name , $ arguments );
36+ $ this ->getFiltrator ()->addFilterInSequence ($ name , $ arguments );
3737 }
3838 else
3939 {
@@ -48,7 +48,7 @@ public function getFiltrator(): IFiltrator {
4848 }
4949
5050 public function addFilter (string $ nameMethod , callable $ callback ): self {
51- $ this ->getFiltrator ()->addFilterRule ($ nameMethod , $ callback );
51+ $ this ->getFiltrator ()->addCustomFilter ($ nameMethod , $ callback );
5252 return $ this ;
5353 }
5454
Original file line number Diff line number Diff line change @@ -32,20 +32,23 @@ public function filtrate($data) {
3232 return $ data ;
3333 }
3434
35- public function addFilter (string $ filterType , array $ filterParams = []): void {
35+ public function addFilterInSequence (string $ filterType , array $ filterParams = []): bool {
3636 if ($ this ->hasFilter ($ filterType )) {
3737 $ this ->sequenceFilters [] = [
3838 'type ' => $ filterType ,
3939 'params ' => $ filterParams
4040 ];
41+ return true ;
4142 }
43+
44+ return false ;
4245 }
4346
4447 public function hasFilter (string $ filterType ): bool {
4548 return \array_key_exists ($ filterType , $ this ->customFilters );
4649 }
4750
48- public function addFilterRule (string $ filterName , callable $ callback ): IFiltrator {
51+ public function addCustomFilter (string $ filterName , callable $ callback ): IFiltrator {
4952 if (!$ this ->hasFilter ($ filterName )) {
5053 $ this ->customFilters [$ filterName ] = $ callback ;
5154 }
Original file line number Diff line number Diff line change @@ -7,9 +7,9 @@ public function filtrate($data);
77
88 public function hasFilter (string $ filterType ): bool ;
99
10- public function addFilterRule (string $ filterName , callable $ callback ): self ;
10+ public function addCustomFilter (string $ filterName , callable $ callback ): self ;
1111
12- public function addFilter (string $ filterType , array $ filterParams = []): void ;
12+ public function addFilterInSequence (string $ filterType , array $ filterParams = []): bool ;
1313
1414 public function filtrateItem (string $ filterType , array $ filterParams , $ data );
1515
You can’t perform that action at this time.
0 commit comments