QueryDecorator   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 9
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A decorate() 0 4 1
1
<?php
2
3
/**
4
 * This software package is licensed under `AGPL-3.0-only, proprietary` license[s].
5
 *
6
 * @package maslosoft/manganel
7
 * @license AGPL-3.0-only, proprietary
8
 *
9
 * @copyright Copyright (c) Peter Maselkowski <[email protected]>
10
 * @link https://maslosoft.com/manganel/
11
 */
12
13
namespace Maslosoft\Manganel\Decorators\QueryBuilder\QueryString;
14
15
use Maslosoft\Manganel\Interfaces\QueryBuilder\QueryStringDecoratorInterface;
16
use Maslosoft\Manganel\SearchCriteria;
17
18
/**
19
 * NOTE: This decorator is by default disabled. Prefered decorator is
20
 * PrefixQueryDecorator, which allows better "As You Type" experience.
21
 *
22
 * @see PrefixQueryDecorator
23
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
24
 */
25
class QueryDecorator implements QueryStringDecoratorInterface
26
{
27
28
	public function decorate(&$queryStringParams, SearchCriteria $criteria)
29
	{
30
		$queryStringParams['query'] = $criteria->getSearch();
31
	}
32
33
}
34