Completed
Push — master ( 230a66...5a1fa2 )
by Peter
34:35 queued 33:08
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
/**
4
 * This software package is licensed under `AGPL-3.0-only, proprietary` license[s].
5
 *
6
 * @package maslosoft/manganel
7
 * @license AGPL-3.0-only, proprietary
8
 *
9
 * @copyright Copyright (c) Peter Maselkowski <[email protected]>
10
 * @link https://maslosoft.com/manganel/
11
 */
12
13
namespace Maslosoft\Manganel\Helpers\Debug;
14
15
use Maslosoft\Manganel\Adapters\Finder\ElasticSearchAdapter;
16
use Maslosoft\Manganel\SearchFinder;
17
18
/**
19
 * DebugFinder
20
 *
21
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
22
 */
23
class DebugFinder
24
{
25
26
	public static function getFormattedParams(SearchFinder $finder)
27
	{
28
		$adapter = $finder->getAdapter();
29
		assert($adapter instanceof ElasticSearchAdapter);
30
		$params = $adapter->getQueryBuilder()->getParams();
31
		return json_encode($params, JSON_PRETTY_PRINT);
32
	}
33
34
}
35