supportsSearchingContext()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace KGzocha\Searcher\CriteriaBuilder\Doctrine;
5
6
use KGzocha\Searcher\Context\Doctrine\ODMBuilderSearchingContext;
7
use KGzocha\Searcher\Context\SearchingContextInterface;
8
use KGzocha\Searcher\CriteriaBuilder\CriteriaBuilderInterface;
9
10
/**
11
 * Abstract CriteriaBuilder that can be used in builders that supports
12
 * only ODMBuilderSearchingContext.
13
 *
14
 * @author Krzysztof Gzocha <[email protected]>
15
 * @author Daniel Ribeiro <[email protected]>
16
 */
17
abstract class AbstractODMCriteriaBuilder implements CriteriaBuilderInterface
18
{
19
    /**
20
     * @param SearchingContextInterface $searchingContext
21
     *
22
     * @return bool
23
     */
24 2
    public function supportsSearchingContext(
25
        SearchingContextInterface $searchingContext
26
    ): bool {
27 2
        return $searchingContext instanceof ODMBuilderSearchingContext;
28
    }
29
}
30