EndTransformer::transform()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace KGzocha\Searcher\Chain;
5
6
use KGzocha\Searcher\Criteria\Collection\CriteriaCollectionInterface;
7
8
/**
9
 * Use this class to indicate that there is no more searchers in the chain.
10
 * It is like a NullObject. It does not do much.
11
 *
12
 * @author Krzysztof Gzocha <[email protected]>
13
 */
14
final class EndTransformer implements TransformerInterface
15
{
16
    /**
17
     * {@inheritdoc}
18
     */
19 1
    public function transform($results, CriteriaCollectionInterface $criteria): CriteriaCollectionInterface
20
    {
21 1
        throw new \RuntimeException(
22 1
            'Transform method on EmptyTransformer should never be called.'
23
        );
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29 5
    public function skip($results): bool
30
    {
31 5
        return false;
32
    }
33
}
34