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

DebugFinder   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 12
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getFormattedParams() 0 7 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
	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