Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
5 / 5 |
|
100.00% |
5 / 5 |
CRAP | |
100.00% |
1 / 1 |
| EmptyQueryClassifiersRepository | |
100.00% |
5 / 5 |
|
100.00% |
5 / 5 |
5 | |
100.00% |
1 / 1 |
| registerClassifier | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| registerClassifierAsCallable | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getConfig | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getClassifier | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getKnownClassifiers | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php declare( strict_types=1 ); |
| 2 | |
| 3 | namespace CirrusSearch\Parser; |
| 4 | |
| 5 | use CirrusSearch\SearchConfig; |
| 6 | use RuntimeException; |
| 7 | |
| 8 | /** |
| 9 | * @license GPL-2.0-or-later |
| 10 | */ |
| 11 | class EmptyQueryClassifiersRepository implements ParsedQueryClassifiersRepository { |
| 12 | |
| 13 | /** @inheritDoc */ |
| 14 | public function registerClassifier( ParsedQueryClassifier $classifier ): void { |
| 15 | } |
| 16 | |
| 17 | /** @inheritDoc */ |
| 18 | public function registerClassifierAsCallable( array $classes, callable $callable ): void { |
| 19 | } |
| 20 | |
| 21 | /** |
| 22 | * @inheritDoc |
| 23 | * @return never |
| 24 | */ |
| 25 | public function getConfig(): SearchConfig { |
| 26 | throw new RuntimeException( self::class . ' does not implement getConfig()' ); |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * @inheritDoc |
| 31 | * @return never |
| 32 | */ |
| 33 | public function getClassifier( $name ) { |
| 34 | throw new ParsedQueryClassifierException( "Classifier {name} not found", [ 'name' => $name ] ); |
| 35 | } |
| 36 | |
| 37 | /** @inheritDoc */ |
| 38 | public function getKnownClassifiers(): array { |
| 39 | return []; |
| 40 | } |
| 41 | |
| 42 | } |