TransformerInterface::transform()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
ccs 0
cts 0
cp 0
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace KGzocha\Searcher\Chain;
5
6
use KGzocha\Searcher\Criteria\Collection\CriteriaCollectionInterface;
7
8
/**
9
 * Only responsibility of services implementing this interface is to transform results and(/or) criteria from previous
10
 * search to CriteriaCollectionInterface that can be used in next search.
11
 *
12
 * @author Krzysztof Gzocha <[email protected]>
13
 */
14
interface TransformerInterface
15
{
16
    /**
17
     * Will transform previous results and criteria into new one,
18
     * that will be used in next cell.
19
     *
20
     * @param mixed                       $results
21
     * @param CriteriaCollectionInterface $criteria
22
     *
23
     * @return CriteriaCollectionInterface
24
     */
25
    public function transform($results, CriteriaCollectionInterface $criteria): CriteriaCollectionInterface;
26
27
    /**
28
     * Important! Results might be null when cell will be used as first one.
29
     *
30
     * @param mixed $results
31
     *
32
     * @return bool
33
     */
34
    public function skip($results): bool;
35
}
36