-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from krzysztof-gzocha/pass-criteria-to-transfo…
…rmer Pass previous criteria to chain transformer
- Loading branch information
Showing
5 changed files
with
12 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
use KGzocha\Searcher\Criteria\Collection\CriteriaCollectionInterface; | ||
|
||
/** | ||
* Only responsibility of services implementing this interface is to transform results from previous | ||
* Only responsibility of services implementing this interface is to transform results and(/or) criteria from previous | ||
* search to CriteriaCollectionInterface that can be used in next search. | ||
* | ||
* @author Krzysztof Gzocha <[email protected]> | ||
|
@@ -14,10 +14,11 @@ interface TransformerInterface | |
{ | ||
/** | ||
* @param mixed $results | ||
* @param CriteriaCollectionInterface $criteria | ||
* | ||
* @return CriteriaCollectionInterface | ||
*/ | ||
public function transform($results); | ||
public function transform($results, CriteriaCollectionInterface $criteria); | ||
|
||
/** | ||
* Important! Results might be null when cell will be used as first one. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
namespace KGzocha\Searcher\Test\Chain; | ||
|
||
use KGzocha\Searcher\Chain\EndTransformer; | ||
use KGzocha\Searcher\Criteria\Collection\CriteriaCollection; | ||
|
||
/** | ||
* @author Krzysztof Gzocha <[email protected]> | ||
|
@@ -21,6 +22,6 @@ public function testSkipMethod() | |
public function testTransformMethod() | ||
{ | ||
$transformer = new EndTransformer(); | ||
$transformer->transform([]); | ||
$transformer->transform([], new CriteriaCollection()); | ||
} | ||
} |