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

DmPrecisionDetector::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
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