Completed
Push — master ( 7d6c96...5af7de )
by Peter
05:54
created

DebugFinder   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 12
ccs 5
cts 5
cp 1
rs 10
c 1
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 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