Completed
Push — master ( 886d11...c65c55 )
by Carsten
04:23 queued 11s
created

GeoDataFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 13
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromArray() 0 9 1
1
<?php
2
namespace Germania\GeoData;
3
4
class GeoDataFactory
5
{
6
7 2
	public function fromArray( array $geodata = null) : GeoData
8
	{
9 2
		$latitude  = $geodata['latitude'] ?? null;
10 2
		$longitude = $geodata['longitude'] ?? null;
11 2
		$provider  = $geodata['provider'] ?? null;
12 2
		$status    = $geodata['status'] ?? null;
13
14 2
		return (new GeoData($latitude, $longitude, $provider))->setStatus( $status );		
15
	}
16
}