Completed
Push — master ( 321c29...f7acb7 )
by Peter
05:07
created

QueryDecorator   A

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
namespace Maslosoft\Manganel\Decorators\QueryBuilder\QueryString;
4
5
use Maslosoft\Manganel\Interfaces\QueryBuilder\QueryStringDecoratorInterface;
6
use Maslosoft\Manganel\SearchCriteria;
7
8
/**
9
 * NOTE: This decorator is by default disabled. Prefered decorator is
10
 * PrefixQueryDecorator, which allows better "As You Type" experience.
11
 *
12
 * @see PrefixQueryDecorator
13
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
14
 */
15
class QueryDecorator implements QueryStringDecoratorInterface
16
{
17
18
	public function decorate(&$queryStringParams, SearchCriteria $criteria)
19
	{
20
		$queryStringParams['query'] = $criteria->getSearch();
21
	}
22
23
}
24