Skip to content

Commit eb9bab2

Browse files
committedMar 17, 2025·
Fix remaining class/variable case
1 parent 9c5d80e commit eb9bab2

File tree

3 files changed

+26
-26
lines changed

3 files changed

+26
-26
lines changed
 

‎CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ The following breaking changes may only affect you if you're writing your own en
5151

5252
🐛 **Bug fixes**
5353

54-
- `WKTParser` and `EWKTParser` now accept both `MULTIPOINT (1 2, 3 4)` and `MULTIPOINT((1 2), (3 4))` syntaxes;
54+
- `WktParser` and `EwktParser` now accept both `MULTIPOINT (1 2, 3 4)` and `MULTIPOINT((1 2), (3 4))` syntaxes;
5555
this notably fixes interoperability issues with PostGIS
5656

5757
## [0.12.0](https://github.com/brick/geo/releases/tag/0.12.0) - 2025-03-09

‎tests/IO/GeoJsonReaderTest.php

+22-22
Original file line numberDiff line numberDiff line change
@@ -16,37 +16,37 @@
1616
class GeoJsonReaderTest extends GeoJsonAbstractTestCase
1717
{
1818
/**
19-
* @param string $geojson The GeoJSON to read.
19+
* @param string $geoJson The GeoJSON to read.
2020
* @param array $coords The expected Geometry coordinates.
2121
* @param bool $is3D Whether the resulting Geometry has a Z coordinate.
2222
* @param bool $lenient Whether to be lenient about case-sensitivity.
2323
*/
2424
#[DataProvider('providerReadGeometry')]
25-
public function testReadGeometry(string $geojson, array $coords, bool $is3D, bool $lenient) : void
25+
public function testReadGeometry(string $geoJson, array $coords, bool $is3D, bool $lenient) : void
2626
{
27-
$geometry = (new GeoJsonReader($lenient))->read($geojson);
27+
$geometry = (new GeoJsonReader($lenient))->read($geoJson);
2828
$this->assertGeometryContents($geometry, $coords, $is3D, false, 4326);
2929
}
3030

3131
public static function providerReadGeometry() : \Generator
3232
{
33-
foreach (self::providerGeometryGeoJson() as [$geojson, $coords, $is3D]) {
34-
yield [$geojson, $coords, $is3D, false];
35-
yield [self::alterCase($geojson), $coords, $is3D, true];
33+
foreach (self::providerGeometryGeoJson() as [$geoJson, $coords, $is3D]) {
34+
yield [$geoJson, $coords, $is3D, false];
35+
yield [self::alterCase($geoJson), $coords, $is3D, true];
3636
}
3737
}
3838

3939
/**
40-
* @param string $geojson The GeoJSON to read.
40+
* @param string $geoJson The GeoJSON to read.
4141
* @param stdClass|null $properties The contained properties.
4242
* @param array|null $coords The expected Geometry coordinates, or null if the Feature has no geometry.
4343
* @param bool $is3D Whether the resulting Geometry has a Z coordinate.
4444
* @param bool $lenient Whether to be lenient about case-sensitivity.
4545
*/
4646
#[DataProvider('providerReadFeature')]
47-
public function testReadFeature(string $geojson, ?stdClass $properties, ?array $coords, bool $is3D, bool $lenient) : void
47+
public function testReadFeature(string $geoJson, ?stdClass $properties, ?array $coords, bool $is3D, bool $lenient) : void
4848
{
49-
$feature = (new GeoJsonReader($lenient))->read($geojson);
49+
$feature = (new GeoJsonReader($lenient))->read($geoJson);
5050

5151
self::assertInstanceOf(Feature::class, $feature);
5252
self::assertEquals($properties, $feature->getProperties());
@@ -62,22 +62,22 @@ public function testReadFeature(string $geojson, ?stdClass $properties, ?array $
6262

6363
public static function providerReadFeature() : \Generator
6464
{
65-
foreach (self::providerFeatureGeoJson() as [$geojson, $properties, $coords, $is3D]) {
66-
yield [$geojson, $properties, $coords, $is3D, false];
67-
yield [self::alterCase($geojson), $properties, $coords, $is3D, true];
65+
foreach (self::providerFeatureGeoJson() as [$geoJson, $properties, $coords, $is3D]) {
66+
yield [$geoJson, $properties, $coords, $is3D, false];
67+
yield [self::alterCase($geoJson), $properties, $coords, $is3D, true];
6868
}
6969
}
7070

7171
/**
72-
* @param string $geojson The GeoJSON to read.
72+
* @param string $geoJson The GeoJSON to read.
7373
* @param array[] $coords The expected Point coordinates.
7474
* @param bool[] $is3D Whether the resulting Point has a Z coordinate.
7575
* @param bool $lenient Whether to be lenient about case-sensitivity.
7676
*/
7777
#[DataProvider('providerReadFeatureCollection')]
78-
public function testReadFeatureCollection(string $geojson, array $properties, array $coords, array $is3D, bool $lenient) : void
78+
public function testReadFeatureCollection(string $geoJson, array $properties, array $coords, array $is3D, bool $lenient) : void
7979
{
80-
$featureCollection = (new GeoJsonReader($lenient))->read($geojson);
80+
$featureCollection = (new GeoJsonReader($lenient))->read($geoJson);
8181

8282
self::assertInstanceOf(FeatureCollection::class, $featureCollection);
8383

@@ -90,9 +90,9 @@ public function testReadFeatureCollection(string $geojson, array $properties, ar
9090

9191
public static function providerReadFeatureCollection() : \Generator
9292
{
93-
foreach (self::providerFeatureCollectionGeoJson() as [$geojson, $properties, $coords, $is3D]) {
94-
yield [$geojson, $properties, $coords, $is3D, false];
95-
yield [self::alterCase($geojson), $properties, $coords, $is3D, true];
93+
foreach (self::providerFeatureCollectionGeoJson() as [$geoJson, $properties, $coords, $is3D]) {
94+
yield [$geoJson, $properties, $coords, $is3D, false];
95+
yield [self::alterCase($geoJson), $properties, $coords, $is3D, true];
9696
}
9797
}
9898

@@ -248,14 +248,14 @@ public function testNestedGeometryCollectionInLenientMode(): void
248248
}
249249

250250
#[DataProvider('providerWrongCaseTypeInNonLenientMode')]
251-
public function testWrongCaseTypeInNonLenientMode(string $geojson, string $expectedExceptionMessage) : void
251+
public function testWrongCaseTypeInNonLenientMode(string $geoJson, string $expectedExceptionMessage) : void
252252
{
253253
$reader = new GeoJsonReader();
254254

255255
$this->expectException(GeometryIoException::class);
256256
$this->expectExceptionMessage($expectedExceptionMessage);
257257

258-
$reader->read($geojson);
258+
$reader->read($geoJson);
259259
}
260260

261261
public static function providerWrongCaseTypeInNonLenientMode() : \Generator
@@ -285,10 +285,10 @@ public static function providerWrongCaseTypeInNonLenientMode() : \Generator
285285
/**
286286
* Changes the case of type attributes.
287287
*/
288-
private static function alterCase(string $geojson) : string
288+
private static function alterCase(string $geoJson) : string
289289
{
290290
$callback = fn(array $matches): string => $matches[1] . strtoupper($matches[2]);
291291

292-
return preg_replace_callback('/("type"\s*\:\s*)("[^"]+")/', $callback, $geojson);
292+
return preg_replace_callback('/("type"\s*\:\s*)("[^"]+")/', $callback, $geoJson);
293293
}
294294
}

‎tests/IO/GeoJsonWriterTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ class GeoJsonWriterTest extends GeoJsonAbstractTestCase
1717
#[DataProvider('providerGeometryGeoJson')]
1818
#[DataProvider('providerFeatureGeoJson')]
1919
#[DataProvider('providerFeatureCollectionGeoJson')]
20-
public function testWriteGeometry(string $geojson) : void
20+
public function testWriteGeometry(string $geoJson) : void
2121
{
22-
$geometry = (new GeoJsonReader())->read($geojson);
22+
$geometry = (new GeoJsonReader())->read($geoJson);
2323
$geometryGeoJson = (new GeoJsonWriter())->write($geometry);
2424

25-
self::assertSame($geojson, $geometryGeoJson);
25+
self::assertSame($geoJson, $geometryGeoJson);
2626
}
2727

2828
public function testPrettyPrint() : void

0 commit comments

Comments
 (0)
Please sign in to comment.