Skip to content

Commit da3e634

Browse files
fbuchlakjbelien
andauthored
style: convert string class names to constants (#1252)
* style: convert string class names to constants * style: fix php-cs-fixer --------- Co-authored-by: Jonathan Beliën <[email protected]>
1 parent b586629 commit da3e634

File tree

35 files changed

+311
-311
lines changed

35 files changed

+311
-311
lines changed

src/Provider/AlgoliaPlaces/Tests/AlgoliaPlacesTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ public function testGeocodeQueryWithLocale(): void
4747
$provider = new AlgoliaPlaces($this->getHttpClient($_SERVER['ALGOLIA_API_KEY'], $_SERVER['ALGOLIA_APP_ID']), $_SERVER['ALGOLIA_API_KEY'], $_SERVER['ALGOLIA_APP_ID']);
4848
$results = $provider->geocodeQuery(GeocodeQuery::create('10 avenue Gambetta, Paris, France')->withLocale('fr-FR'));
4949

50-
$this->assertInstanceOf('Geocoder\Model\AddressCollection', $results);
50+
$this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results);
5151
$this->assertCount(1, $results);
5252

5353
/** @var Location $result */
5454
$result = $results->first();
55-
$this->assertInstanceOf('\Geocoder\Model\Address', $result);
55+
$this->assertInstanceOf(\Geocoder\Model\Address::class, $result);
5656
$this->assertEqualsWithDelta(48.8653, $result->getCoordinates()->getLatitude(), 0.01);
5757
$this->assertEqualsWithDelta(2.39844, $result->getCoordinates()->getLongitude(), 0.01);
5858

@@ -72,12 +72,12 @@ public function testGeocodeQueryWithoutLocale(): void
7272
$provider = new AlgoliaPlaces($this->getHttpClient($_SERVER['ALGOLIA_API_KEY'], $_SERVER['ALGOLIA_APP_ID']), $_SERVER['ALGOLIA_API_KEY'], $_SERVER['ALGOLIA_APP_ID']);
7373
$results = $provider->geocodeQuery(GeocodeQuery::create('Paris, France'));
7474

75-
$this->assertInstanceOf('Geocoder\Model\AddressCollection', $results);
75+
$this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results);
7676
$this->assertCount(20, $results);
7777

7878
/** @var Location $result */
7979
$result = $results->first();
80-
$this->assertInstanceOf('\Geocoder\Model\Address', $result);
80+
$this->assertInstanceOf(\Geocoder\Model\Address::class, $result);
8181
$this->assertEqualsWithDelta(48.8546, $result->getCoordinates()->getLatitude(), 0.01);
8282
$this->assertEqualsWithDelta(2.34771, $result->getCoordinates()->getLongitude(), 0.01);
8383

@@ -93,7 +93,7 @@ public function testGeocodeUnauthenticated(): void
9393
$provider = new AlgoliaPlaces($this->getHttpClient());
9494
$results = $provider->geocodeQuery(GeocodeQuery::create('Paris, France'));
9595

96-
$this->assertInstanceOf('Geocoder\Model\AddressCollection', $results);
96+
$this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results);
9797
$this->assertCount(20, $results);
9898
}
9999

src/Provider/ArcGISOnline/Tests/ArcGISOnlineTest.php

+12-12
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ public function testGeocodeWithRealAddress(): void
5555
$provider = new ArcGISOnline($this->getHttpClient());
5656
$results = $provider->geocodeQuery(GeocodeQuery::create('10 avenue Gambetta, Paris, France'));
5757

58-
$this->assertInstanceOf('Geocoder\Model\AddressCollection', $results);
58+
$this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results);
5959
$this->assertCount(5, $results);
6060

6161
/** @var Location $result */
6262
$result = $results->first();
63-
$this->assertInstanceOf('\Geocoder\Model\Address', $result);
63+
$this->assertInstanceOf(\Geocoder\Model\Address::class, $result);
6464
$this->assertEqualsWithDelta(48.863279997000461, $result->getCoordinates()->getLatitude(), 0.0001);
6565
$this->assertEqualsWithDelta(2.3890199980004354, $result->getCoordinates()->getLongitude(), 0.0001);
6666
$this->assertEquals(10, $result->getStreetNumber());
@@ -88,11 +88,11 @@ public function testGeocodeWithToken(): void
8888
$provider = ArcGISOnline::token($this->getHttpClient($_SERVER['ARCGIS_TOKEN']), $_SERVER['ARCGIS_TOKEN']);
8989
$results = $provider->geocodeQuery(GeocodeQuery::create('5754 WI-23, Spring Green, WI 53588, USA'));
9090

91-
$this->assertInstanceOf('Geocoder\Model\AddressCollection', $results);
91+
$this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results);
9292

9393
/** @var Location $result */
9494
$result = $results->first();
95-
$this->assertInstanceOf('\Geocoder\Model\Address', $result);
95+
$this->assertInstanceOf(\Geocoder\Model\Address::class, $result);
9696
$this->assertEqualsWithDelta(43.093663, $result->getCoordinates()->getLatitude(), 0.0001);
9797
$this->assertEqualsWithDelta(-90.131796, $result->getCoordinates()->getLongitude(), 0.0001);
9898
$this->assertEquals(5754, $result->getStreetNumber());
@@ -126,12 +126,12 @@ public function testReverseWithRealCoordinates(): void
126126
$provider = new ArcGISOnline($this->getHttpClient(), null);
127127
$results = $provider->reverseQuery(ReverseQuery::fromCoordinates(48.863279997000461, 2.3890199980004354));
128128

129-
$this->assertInstanceOf('Geocoder\Model\AddressCollection', $results);
129+
$this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results);
130130
$this->assertCount(1, $results);
131131

132132
/** @var \Geocoder\Model\Address $result */
133133
$result = $results->first();
134-
$this->assertInstanceOf('\Geocoder\Model\Address', $result);
134+
$this->assertInstanceOf(\Geocoder\Model\Address::class, $result);
135135
$this->assertEqualsWithDelta(48.863279997000461, $result->getCoordinates()->getLatitude(), 0.0001);
136136
$this->assertEqualsWithDelta(2.3890199980004354, $result->getCoordinates()->getLongitude(), 0.0001);
137137
$this->assertNull($result->getStreetNumber());
@@ -152,12 +152,12 @@ public function testGeocodeWithCity(): void
152152
$provider = new ArcGISOnline($this->getHttpClient());
153153
$results = $provider->geocodeQuery(GeocodeQuery::create('Hannover'));
154154

155-
$this->assertInstanceOf('Geocoder\Model\AddressCollection', $results);
155+
$this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results);
156156
$this->assertCount(5, $results);
157157

158158
/** @var Location $result */
159159
$result = $results->first();
160-
$this->assertInstanceOf('\Geocoder\Model\Address', $result);
160+
$this->assertInstanceOf(\Geocoder\Model\Address::class, $result);
161161
$this->assertEqualsWithDelta(52.37227000000007, $result->getCoordinates()->getLatitude(), 0.0001);
162162
$this->assertEqualsWithDelta(9.738150000000076, $result->getCoordinates()->getLongitude(), 0.0001);
163163
$this->assertNull($result->getStreetNumber());
@@ -175,7 +175,7 @@ public function testGeocodeWithCity(): void
175175

176176
/** @var Location $result */
177177
$result = $results->get(1);
178-
$this->assertInstanceOf('\Geocoder\Model\Address', $result);
178+
$this->assertInstanceOf(\Geocoder\Model\Address::class, $result);
179179
$this->assertEqualsWithDelta(39.391768472000479, $result->getCoordinates()->getLatitude(), 0.0001);
180180
$this->assertEqualsWithDelta(-77.440257128999633, $result->getCoordinates()->getLongitude(), 0.0001);
181181
$this->assertNull($result->getStreetName());
@@ -186,7 +186,7 @@ public function testGeocodeWithCity(): void
186186

187187
/** @var Location $result */
188188
$result = $results->get(2);
189-
$this->assertInstanceOf('\Geocoder\Model\Address', $result);
189+
$this->assertInstanceOf(\Geocoder\Model\Address::class, $result);
190190
$this->assertEqualsWithDelta(53.174198173, $result->getCoordinates()->getLatitude(), 0.0001);
191191
$this->assertEqualsWithDelta(8.5069383810005, $result->getCoordinates()->getLongitude(), 0.0001);
192192
$this->assertNull($result->getStreetName());
@@ -197,7 +197,7 @@ public function testGeocodeWithCity(): void
197197

198198
/** @var Location $result */
199199
$result = $results->get(3);
200-
$this->assertInstanceOf('\Geocoder\Model\Address', $result);
200+
$this->assertInstanceOf(\Geocoder\Model\Address::class, $result);
201201
$this->assertEqualsWithDelta(47.111290000000054, $result->getCoordinates()->getLatitude(), 0.0001);
202202
$this->assertEqualsWithDelta(-101.42142999999999, $result->getCoordinates()->getLongitude(), 0.0001);
203203
$this->assertNull($result->getStreetName());
@@ -208,7 +208,7 @@ public function testGeocodeWithCity(): void
208208

209209
/** @var Location $result */
210210
$result = $results->get(4);
211-
$this->assertInstanceOf('\Geocoder\Model\Address', $result);
211+
$this->assertInstanceOf(\Geocoder\Model\Address::class, $result);
212212
$this->assertEqualsWithDelta(32.518790000000024, $result->getCoordinates()->getLatitude(), 0.0001);
213213
$this->assertEqualsWithDelta(-90.06298999999996, $result->getCoordinates()->getLongitude(), 0.0001);
214214
$this->assertNull($result->getStreetName());

src/Provider/BingMaps/Tests/BingMapsTest.php

+11-11
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ public function testGeocodeReturnsMultipleResults(): void
7070
$provider = new BingMaps($this->getMockedHttpClient($json), 'api_key');
7171
$results = $provider->geocodeQuery(GeocodeQuery::create('10 avenue Gambetta, Paris, France'));
7272

73-
$this->assertInstanceOf('Geocoder\Model\AddressCollection', $results);
73+
$this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results);
7474
$this->assertCount(3, $results);
7575

7676
/** @var Location $result */
7777
$result = $results->first();
78-
$this->assertInstanceOf('\Geocoder\Model\Address', $result);
78+
$this->assertInstanceOf(\Geocoder\Model\Address::class, $result);
7979
$this->assertEqualsWithDelta(48.86321675999999, $result->getCoordinates()->getLatitude(), 0.01);
8080
$this->assertEqualsWithDelta(2.3887721299999995, $result->getCoordinates()->getLongitude(), 0.01);
8181
$this->assertNotNull($result->getBounds());
@@ -97,7 +97,7 @@ public function testGeocodeReturnsMultipleResults(): void
9797

9898
/** @var Location $result */
9999
$result = $results->get(1);
100-
$this->assertInstanceOf('\Geocoder\Model\Address', $result);
100+
$this->assertInstanceOf(\Geocoder\Model\Address::class, $result);
101101
$this->assertEqualsWithDelta(48.81342781, $result->getCoordinates()->getLatitude(), 0.01);
102102
$this->assertEqualsWithDelta(2.32503767, $result->getCoordinates()->getLongitude(), 0.01);
103103
$this->assertNotNull($result->getBounds());
@@ -117,7 +117,7 @@ public function testGeocodeReturnsMultipleResults(): void
117117

118118
/** @var Location $result */
119119
$result = $results->get(2);
120-
$this->assertInstanceOf('\Geocoder\Model\Address', $result);
120+
$this->assertInstanceOf(\Geocoder\Model\Address::class, $result);
121121
$this->assertEqualsWithDelta(48.81014147, $result->getCoordinates()->getLatitude(), 0.01);
122122
$this->assertEqualsWithDelta(2.43568048, $result->getCoordinates()->getLongitude(), 0.01);
123123
$this->assertNotNull($result->getBounds());
@@ -145,12 +145,12 @@ public function testReverseReturnsSingleResult(): void
145145
$provider = new BingMaps($this->getMockedHttpClient($json), 'api_key');
146146
$results = $provider->reverseQuery(ReverseQuery::fromCoordinates(48.86321648955345, 2.3887719959020615));
147147

148-
$this->assertInstanceOf('Geocoder\Model\AddressCollection', $results);
148+
$this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results);
149149
$this->assertCount(1, $results);
150150

151151
/** @var Location $result */
152152
$result = $results->first();
153-
$this->assertInstanceOf('\Geocoder\Model\Address', $result);
153+
$this->assertInstanceOf(\Geocoder\Model\Address::class, $result);
154154
$this->assertEqualsWithDelta(48.86321648955345, $result->getCoordinates()->getLatitude(), 0.0001);
155155
$this->assertEqualsWithDelta(2.3887719959020615, $result->getCoordinates()->getLongitude(), 0.0001);
156156
$this->assertNotNull($result->getBounds());
@@ -180,12 +180,12 @@ public function testGeocodeWithRealAddressReturnsSingleResults(): void
180180
$provider = new BingMaps($this->getHttpClient($_SERVER['BINGMAPS_API_KEY']), $_SERVER['BINGMAPS_API_KEY']);
181181
$results = $provider->geocodeQuery(GeocodeQuery::create('10 avenue Gambetta, Paris, France')->withLocale('fr-FR'));
182182

183-
$this->assertInstanceOf('Geocoder\Model\AddressCollection', $results);
183+
$this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results);
184184
$this->assertCount(1, $results);
185185

186186
/** @var Location $result */
187187
$result = $results->first();
188-
$this->assertInstanceOf('\Geocoder\Model\Address', $result);
188+
$this->assertInstanceOf(\Geocoder\Model\Address::class, $result);
189189
$this->assertEqualsWithDelta(48.86321675999999, $result->getCoordinates()->getLatitude(), 0.01);
190190
$this->assertEqualsWithDelta(2.3887721299999995, $result->getCoordinates()->getLongitude(), 0.01);
191191
$this->assertNotNull($result->getBounds());
@@ -217,7 +217,7 @@ public function testGeocodeWithRealAddressReturnsMultipleResults(): void
217217
$provider = new BingMaps($this->getHttpClient($_SERVER['BINGMAPS_API_KEY']), $_SERVER['BINGMAPS_API_KEY']);
218218
$results = $provider->geocodeQuery(GeocodeQuery::create('Castelnuovo, Italie')->withLocale('fr-FR'));
219219

220-
$this->assertInstanceOf('Geocoder\Model\AddressCollection', $results);
220+
$this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results);
221221
$this->assertCount(5, $results);
222222
}
223223

@@ -230,12 +230,12 @@ public function testReverseWithRealCoordinatesReturnsSingleResult(): void
230230
$provider = new BingMaps($this->getHttpClient($_SERVER['BINGMAPS_API_KEY']), $_SERVER['BINGMAPS_API_KEY']);
231231
$results = $provider->reverseQuery(ReverseQuery::fromCoordinates(48.86321648955345, 2.3887719959020615));
232232

233-
$this->assertInstanceOf('Geocoder\Model\AddressCollection', $results);
233+
$this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results);
234234
$this->assertCount(1, $results);
235235

236236
/** @var Location $result */
237237
$result = $results->first();
238-
$this->assertInstanceOf('\Geocoder\Model\Address', $result);
238+
$this->assertInstanceOf(\Geocoder\Model\Address::class, $result);
239239
$this->assertEqualsWithDelta(48.86321648955345, $result->getCoordinates()->getLatitude(), 0.0001);
240240
$this->assertEqualsWithDelta(2.3887719959020615, $result->getCoordinates()->getLongitude(), 0.0001);
241241
$this->assertNotNull($result->getBounds());

src/Provider/Chain/Tests/ChainTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ChainTest extends TestCase
2727
{
2828
public function testAdd(): void
2929
{
30-
$mock = $this->getMockBuilder('Geocoder\Provider\Provider')->getMock();
30+
$mock = $this->getMockBuilder(Provider::class)->getMock();
3131
$chain = new Chain();
3232

3333
$chain->add($mock);
@@ -49,7 +49,7 @@ public function testReverse(): void
4949
throw new \Exception();
5050
}));
5151

52-
$mockTwo = $this->getMockBuilder('Geocoder\\Provider\\Provider')->getMock();
52+
$mockTwo = $this->getMockBuilder(Provider::class)->getMock();
5353
$result = new AddressCollection(['foo' => 'bar']);
5454
$mockTwo->expects($this->once())
5555
->method('reverseQuery')
@@ -63,14 +63,14 @@ public function testReverse(): void
6363
public function testGeocode(): void
6464
{
6565
$query = GeocodeQuery::create('Paris');
66-
$mockOne = $this->getMockBuilder('Geocoder\\Provider\\Provider')->getMock();
66+
$mockOne = $this->getMockBuilder(Provider::class)->getMock();
6767
$mockOne->expects($this->once())
6868
->method('geocodeQuery')
6969
->will($this->returnCallback(function () {
7070
throw new \Exception();
7171
}));
7272

73-
$mockTwo = $this->getMockBuilder('Geocoder\\Provider\\Provider')->getMock();
73+
$mockTwo = $this->getMockBuilder(Provider::class)->getMock();
7474
$result = new AddressCollection(['foo' => 'bar']);
7575
$mockTwo->expects($this->once())
7676
->method('geocodeQuery')

0 commit comments

Comments
 (0)