Completed
Pull Request — master (#168)
by Jeroen De
02:05
created

DmPrecisionDetector::detectDegreePrecision()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 6
cts 6
cp 1
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace DataValues\Geo\PackagePrivate;
6
7
class DmPrecisionDetector extends PrecisionDetector {
8
9
	private $dmsPrecisionDetector;
10
11 15
	public function __construct() {
12 15
		$this->dmsPrecisionDetector = new DmsPrecisionDetector();
13 15
	}
14
15 15
	protected function detectDegreePrecision( float $degree ): float {
16 15
		$minutes = $degree * 60;
17 15
		$split = explode( '.', (string)round( $minutes, 6 ) );
18
19 15
		if ( isset( $split[1] ) ) {
20 9
			return $this->dmsPrecisionDetector->detectDegreePrecision( $degree );
0 ignored issues
show
Bug introduced by
The method detectDegreePrecision() cannot be called from this context as it is declared protected in class DataValues\Geo\PackagePrivate\DmsPrecisionDetector.

This check looks for access to methods that are not accessible from the current context.

If you need to make a method accessible to another context you can raise its visibility level in the defining class.

Loading history...
21
		}
22
23 6
		return 1 / 60;
24
	}
25
26
}
27