Passed
Push — master ( 0e515b...d33c99 )
by Roberto
03:56
created
src/Fields/AddressComponentFields.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -16,19 +16,19 @@
 block discarded – undo
16 16
  */
17 17
 class AddressComponentFields {
18 18
 
19
-	/**
20
-	 * string: long_name
21
-	 */
22
-	const LONG_NAME = 'long_name';
19
+    /**
20
+     * string: long_name
21
+     */
22
+    const LONG_NAME = 'long_name';
23 23
 
24
-	/**
25
-	 * string: short_name
26
-	 */
27
-	const SHORT_NAME = 'short_name';
24
+    /**
25
+     * string: short_name
26
+     */
27
+    const SHORT_NAME = 'short_name';
28 28
 
29
-	/**
30
-	 * string: types
31
-	 */
32
-	const TYPES = 'types';
29
+    /**
30
+     * string: types
31
+     */
32
+    const TYPES = 'types';
33 33
 
34 34
 }
35 35
\ No newline at end of file
Please login to merge, or discard this patch.
src/Fields/GoogleMapsResponseFields.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -16,19 +16,19 @@
 block discarded – undo
16 16
  */
17 17
 class GoogleMapsResponseFields {
18 18
 
19
-	/**
20
-	 * string: results
21
-	 */
22
-	const RESULTS = 'results';
19
+    /**
20
+     * string: results
21
+     */
22
+    const RESULTS = 'results';
23 23
 
24
-	/**
25
-	 * string: status
26
-	 */
27
-	const STATUS = 'status';
24
+    /**
25
+     * string: status
26
+     */
27
+    const STATUS = 'status';
28 28
 
29
-	/**
30
-	 * string: error_message
31
-	 */
32
-	const ERROR_MESSAGE = 'error_message';
29
+    /**
30
+     * string: error_message
31
+     */
32
+    const ERROR_MESSAGE = 'error_message';
33 33
 
34 34
 }
35 35
\ No newline at end of file
Please login to merge, or discard this patch.
src/Fields/LatLngFields.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -16,13 +16,13 @@
 block discarded – undo
16 16
  */
17 17
 class LatLngFields {
18 18
 
19
-	/**
20
-	 * string - latitude
21
-	 */
22
-	const LAT = 'lat';
19
+    /**
20
+     * string - latitude
21
+     */
22
+    const LAT = 'lat';
23 23
 
24
-	/**
25
-	 * string - longitude
26
-	 */
27
-	const LNG = 'lng';
24
+    /**
25
+     * string - longitude
26
+     */
27
+    const LNG = 'lng';
28 28
 }
29 29
\ No newline at end of file
Please login to merge, or discard this patch.
src/Abstracts/Api.php 1 patch
Indentation   +89 added lines, -89 removed lines patch added patch discarded remove patch
@@ -21,93 +21,93 @@
 block discarded – undo
21 21
  */
22 22
 abstract class Api {
23 23
 
24
-	/**
25
-	 * @var string
26
-	 */
27
-	const SERVICE_ENDPOINT = null;
28
-
29
-	/**
30
-	 * @var GoogleMapsApi
31
-	 */
32
-	protected $google_maps_api = null;
33
-
34
-	/**
35
-	 * @var string
36
-	 */
37
-	protected $result_collection = '';
38
-
39
-	/**
40
-	 * Api constructor.
41
-	 *
42
-	 * @param array $config
43
-	 */
44
-	public function __construct(array $config = []) {
45
-
46
-		$service_config = $this->getServiceConfig($config);
47
-		$this->setGoogleMapsApi(new GoogleMapsApi($service_config));
48
-	}
49
-
50
-	/**
51
-	 * @param array $config
52
-	 *
53
-	 * @return array
54
-	 */
55
-	protected function getServiceConfig(array $config = []): array {
56
-
57
-		return array_merge($config, [
58
-			GoogleMapsApiConfigFields::SERVICE_ENDPOINT => $this->getServiceEndpoint()
59
-		]);
60
-	}
61
-
62
-	/**
63
-	 * @return string
64
-	 */
65
-	public function getServiceEndpoint(): string {
66
-
67
-		return static::SERVICE_ENDPOINT;
68
-	}
69
-
70
-	/**
71
-	 * @return GoogleMapsApi
72
-	 */
73
-	public function getGoogleMapsApi(): GoogleMapsApi {
74
-
75
-		return $this->google_maps_api;
76
-	}
77
-
78
-	/**
79
-	 * @param GoogleMapsApi $google_maps_api
80
-	 *
81
-	 * @return Api
82
-	 */
83
-	public function setGoogleMapsApi(GoogleMapsApi $google_maps_api): Api {
84
-
85
-		$this->google_maps_api = $google_maps_api;
86
-
87
-		return $this;
88
-	}
89
-
90
-	/**
91
-	 * @param array $params
92
-	 *
93
-	 * @return mixed
94
-	 */
95
-	public function createRequest(array $params): GoogleMapsRequest {
96
-
97
-		return new GoogleMapsRequest($params);
98
-	}
99
-
100
-	/**
101
-	 * @param GoogleMapsRequest $request
102
-	 *
103
-	 * @return GoogleMapsResultsCollection
104
-	 */
105
-	public function getResultsCollections(GoogleMapsRequest $request): GoogleMapsResultsCollection {
106
-
107
-		$results = $this->getGoogleMapsApi()->get($request)->getResults();
108
-
109
-		$result_collection_class = $this->result_collection;
110
-
111
-		return new $result_collection_class($results);
112
-	}
24
+    /**
25
+     * @var string
26
+     */
27
+    const SERVICE_ENDPOINT = null;
28
+
29
+    /**
30
+     * @var GoogleMapsApi
31
+     */
32
+    protected $google_maps_api = null;
33
+
34
+    /**
35
+     * @var string
36
+     */
37
+    protected $result_collection = '';
38
+
39
+    /**
40
+     * Api constructor.
41
+     *
42
+     * @param array $config
43
+     */
44
+    public function __construct(array $config = []) {
45
+
46
+        $service_config = $this->getServiceConfig($config);
47
+        $this->setGoogleMapsApi(new GoogleMapsApi($service_config));
48
+    }
49
+
50
+    /**
51
+     * @param array $config
52
+     *
53
+     * @return array
54
+     */
55
+    protected function getServiceConfig(array $config = []): array {
56
+
57
+        return array_merge($config, [
58
+            GoogleMapsApiConfigFields::SERVICE_ENDPOINT => $this->getServiceEndpoint()
59
+        ]);
60
+    }
61
+
62
+    /**
63
+     * @return string
64
+     */
65
+    public function getServiceEndpoint(): string {
66
+
67
+        return static::SERVICE_ENDPOINT;
68
+    }
69
+
70
+    /**
71
+     * @return GoogleMapsApi
72
+     */
73
+    public function getGoogleMapsApi(): GoogleMapsApi {
74
+
75
+        return $this->google_maps_api;
76
+    }
77
+
78
+    /**
79
+     * @param GoogleMapsApi $google_maps_api
80
+     *
81
+     * @return Api
82
+     */
83
+    public function setGoogleMapsApi(GoogleMapsApi $google_maps_api): Api {
84
+
85
+        $this->google_maps_api = $google_maps_api;
86
+
87
+        return $this;
88
+    }
89
+
90
+    /**
91
+     * @param array $params
92
+     *
93
+     * @return mixed
94
+     */
95
+    public function createRequest(array $params): GoogleMapsRequest {
96
+
97
+        return new GoogleMapsRequest($params);
98
+    }
99
+
100
+    /**
101
+     * @param GoogleMapsRequest $request
102
+     *
103
+     * @return GoogleMapsResultsCollection
104
+     */
105
+    public function getResultsCollections(GoogleMapsRequest $request): GoogleMapsResultsCollection {
106
+
107
+        $results = $this->getGoogleMapsApi()->get($request)->getResults();
108
+
109
+        $result_collection_class = $this->result_collection;
110
+
111
+        return new $result_collection_class($results);
112
+    }
113 113
 }
114 114
\ No newline at end of file
Please login to merge, or discard this patch.
src/Http/GoogleMapsResultsCollection.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -18,20 +18,20 @@
 block discarded – undo
18 18
  */
19 19
 class GoogleMapsResultsCollection extends AbstractCollection {
20 20
 
21
-	/**
22
-	 * @var string
23
-	 */
24
-	protected $item_class = GoogleMapsResult::class;
21
+    /**
22
+     * @var string
23
+     */
24
+    protected $item_class = GoogleMapsResult::class;
25 25
 
26
-	/**
27
-	 * @param $item
28
-	 *
29
-	 * @return GeocodingResult
30
-	 */
31
-	protected function parseItem($item) {
26
+    /**
27
+     * @param $item
28
+     *
29
+     * @return GeocodingResult
30
+     */
31
+    protected function parseItem($item) {
32 32
 
33
-		$item_class = $this->item_class;
33
+        $item_class = $this->item_class;
34 34
 
35
-		return new $item_class($item);
36
-	}
35
+        return new $item_class($item);
36
+    }
37 37
 }
38 38
\ No newline at end of file
Please login to merge, or discard this patch.
src/Http/Result/ElevationResult.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -29,28 +29,28 @@
 block discarded – undo
29 29
  */
30 30
 class ElevationResult extends GoogleMapsResult {
31 31
 
32
-	/**
33
-	 * @var float
34
-	 */
35
-	protected $elevation = null;
36
-
37
-	/**
38
-	 * @var Location
39
-	 */
40
-	protected $location = null;
41
-
42
-	/**
43
-	 * @var float
44
-	 */
45
-	protected $resolution = null;
46
-
47
-	/**
48
-	 * @var array
49
-	 */
50
-	protected $typeCheck = [
51
-		GoogleMapsResultFields::LOCATION   => Location::class,
52
-		GoogleMapsResultFields::ELEVATION  => 'float',
53
-		GoogleMapsResultFields::RESOLUTION => 'float',
54
-	];
32
+    /**
33
+     * @var float
34
+     */
35
+    protected $elevation = null;
36
+
37
+    /**
38
+     * @var Location
39
+     */
40
+    protected $location = null;
41
+
42
+    /**
43
+     * @var float
44
+     */
45
+    protected $resolution = null;
46
+
47
+    /**
48
+     * @var array
49
+     */
50
+    protected $typeCheck = [
51
+        GoogleMapsResultFields::LOCATION   => Location::class,
52
+        GoogleMapsResultFields::ELEVATION  => 'float',
53
+        GoogleMapsResultFields::RESOLUTION => 'float',
54
+    ];
55 55
 
56 56
 }
57 57
\ No newline at end of file
Please login to merge, or discard this patch.
src/Http/Result/ElevationResultsCollection.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,8 +20,8 @@
 block discarded – undo
20 20
  */
21 21
 class ElevationResultsCollection extends GoogleMapsResultsCollection {
22 22
 
23
-	/**
24
-	 * @var string
25
-	 */
26
-	protected $item_class = ElevationResult::class;
23
+    /**
24
+     * @var string
25
+     */
26
+    protected $item_class = ElevationResult::class;
27 27
 }
28 28
\ No newline at end of file
Please login to merge, or discard this patch.
src/Http/Result/GeocodingResultsCollection.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@
 block discarded – undo
18 18
  */
19 19
 class GeocodingResultsCollection extends GoogleMapsResultsCollection {
20 20
 
21
-	/**
22
-	 * @var string
23
-	 */
24
-	protected $item_class = GeocodingResult::class;
21
+    /**
22
+     * @var string
23
+     */
24
+    protected $item_class = GeocodingResult::class;
25 25
 }
26 26
\ No newline at end of file
Please login to merge, or discard this patch.
src/Api/Geocoding.php 1 patch
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -25,56 +25,56 @@
 block discarded – undo
25 25
  */
26 26
 class Geocoding extends Api {
27 27
 
28
-	/**
29
-	 * @var string
30
-	 */
31
-	const SERVICE_ENDPOINT = 'geocode';
28
+    /**
29
+     * @var string
30
+     */
31
+    const SERVICE_ENDPOINT = 'geocode';
32 32
 
33
-	/**
34
-	 * @var string
35
-	 */
36
-	protected $result_collection = GeocodingResultsCollection::class;
33
+    /**
34
+     * @var string
35
+     */
36
+    protected $result_collection = GeocodingResultsCollection::class;
37 37
 
38
-	/**
39
-	 * @param string $literal_address
40
-	 *
41
-	 * @return GoogleMapsResultsCollection
42
-	 */
43
-	public function getByAddress(string $literal_address): GoogleMapsResultsCollection {
38
+    /**
39
+     * @param string $literal_address
40
+     *
41
+     * @return GoogleMapsResultsCollection
42
+     */
43
+    public function getByAddress(string $literal_address): GoogleMapsResultsCollection {
44 44
 
45
-		$request = new GoogleMapsRequest([
46
-			GoogleMapsRequestFields::ADDRESS => $literal_address
47
-		]);
45
+        $request = new GoogleMapsRequest([
46
+            GoogleMapsRequestFields::ADDRESS => $literal_address
47
+        ]);
48 48
 
49
-		return $this->getResultsCollections($request);
50
-	}
49
+        return $this->getResultsCollections($request);
50
+    }
51 51
 
52
-	/**
53
-	 * @param LatLng $latlng
54
-	 *
55
-	 * @return GoogleMapsResultsCollection
56
-	 */
57
-	public function getReverse(LatLng $latlng): GoogleMapsResultsCollection {
52
+    /**
53
+     * @param LatLng $latlng
54
+     *
55
+     * @return GoogleMapsResultsCollection
56
+     */
57
+    public function getReverse(LatLng $latlng): GoogleMapsResultsCollection {
58 58
 
59
-		$request = $this->createRequest([
60
-			GoogleMapsRequestFields::LATLNG => $latlng
61
-		]);
59
+        $request = $this->createRequest([
60
+            GoogleMapsRequestFields::LATLNG => $latlng
61
+        ]);
62 62
 
63
-		return $this->getResultsCollections($request);
64
-	}
63
+        return $this->getResultsCollections($request);
64
+    }
65 65
 
66
-	/**
67
-	 * @param string $place_id
68
-	 *
69
-	 * @return GoogleMapsResultsCollection
70
-	 */
71
-	public function getByPlaceId(string $place_id): GoogleMapsResultsCollection {
66
+    /**
67
+     * @param string $place_id
68
+     *
69
+     * @return GoogleMapsResultsCollection
70
+     */
71
+    public function getByPlaceId(string $place_id): GoogleMapsResultsCollection {
72 72
 
73
-		$request = $this->createRequest([
74
-			GoogleMapsRequestFields::PLACE_ID => $place_id
75
-		]);
73
+        $request = $this->createRequest([
74
+            GoogleMapsRequestFields::PLACE_ID => $place_id
75
+        ]);
76 76
 
77
-		return $this->getResultsCollections($request);
78
-	}
77
+        return $this->getResultsCollections($request);
78
+    }
79 79
 
80 80
 }
81 81
\ No newline at end of file
Please login to merge, or discard this patch.