Completed
Push — multimodel-dp ( 745c1d...bcd65b )
by Peter
03:53
created

DebugFinder::getFormattedParams()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 0
cts 7
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Maslosoft\Manganel\Helpers\Debug;
4
5
use Maslosoft\Manganel\Adapters\Finder\ElasticSearchAdapter;
6
use Maslosoft\Manganel\SearchFinder;
7
8
/**
9
 * DebugFinder
10
 *
11
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
12
 */
13
class DebugFinder
14
{
15
16
	public static function getFormattedParams(SearchFinder $finder)
17
	{
18
		$adapter = $finder->getAdapter();
19
		assert($adapter instanceof ElasticSearchAdapter);
20
		$params = $adapter->getQueryBuilder()->getParams();
21
		return json_encode($params, JSON_PRETTY_PRINT);
22
	}
23
24
}
25