Completed
Push — multimodel-dp ( 3c278b...934eb7 )
by Peter
08:07
created

DebugFinder::getFormattedParams()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 7
ccs 5
cts 5
cp 1
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 5
nc 1
nop 1
crap 1
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 1
	public static function getFormattedParams(SearchFinder $finder)
17
	{
18 1
		$adapter = $finder->getAdapter();
19 1
		assert($adapter instanceof ElasticSearchAdapter);
20 1
		$params = $adapter->getQueryBuilder()->getParams();
21 1
		return json_encode($params, JSON_PRETTY_PRINT);
22
	}
23
24
}
25