Skip to content

Commit 1717c99

Browse files
batyrmastyrSurfoo
authored andcommitted
PHP 8.4 support
1 parent b07e741 commit 1717c99

File tree

10 files changed

+25
-17
lines changed

10 files changed

+25
-17
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
php: [ '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]
13+
php: [ '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
1414
strategy: [ 'highest' ]
1515
sf_version: ['']
1616
include:
@@ -26,6 +26,8 @@ jobs:
2626
sf_version: '6.*'
2727
- php: 8.3
2828
sf_version: '7.*'
29+
- php: 8.4
30+
sf_version: '7.*'
2931

3032
steps:
3133
- name: Checkout code

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
CHANGELOG
22
=========
33

4+
1.3.0
5+
-----
6+
### Fixed
7+
8+
- PHP 8.4 support by @batyrmastyr in #194
9+
410
1.2.0
511
-----
612
### Fixed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"require" : {
2525
"php" : "^7.3 || ^7.4 || ^8.0",
2626
"psr/cache" : "^1.0 || ^2.0 || ^3.0",
27-
"willdurand/geocoder" : "^4.5",
28-
"react/promise" : "^2.8",
27+
"willdurand/geocoder" : "^4.5 || ^5.0",
28+
"react/promise" : "^2.8 || ^3.0",
2929
"symfony/console" : "^4.4 || ^5.0 || ^6.0 || ^7.0",
3030
"symfony/property-access" : "^4.4 || ^5.0 || ^6.0 || ^7.0",
3131
"symfony/serializer" : "^4.4 || ^5.0 || ^6.0 || ^7.0",

src/Batch/Batch.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function geocode($values)
124124
}
125125
} catch (\Exception $e) {
126126
$batchGeocoded = new BatchResult($provider->getName(), $value, $e->getMessage());
127-
$deferred->reject($batchGeocoded->newInstance());
127+
$deferred->resolve($batchGeocoded->newInstance());
128128
}
129129

130130
return $deferred->promise();
@@ -144,7 +144,7 @@ public function geocode($values)
144144
}
145145
} catch (\Exception $e) {
146146
$batchGeocoded = new BatchResult($provider->getName(), $values, $e->getMessage());
147-
$deferred->reject($batchGeocoded->newInstance());
147+
$deferred->resolve($batchGeocoded->newInstance());
148148
}
149149

150150
return $deferred->promise();
@@ -188,7 +188,7 @@ public function reverse($coordinates)
188188
}
189189
} catch (\Exception $e) {
190190
$batchGeocoded = new BatchResult($provider->getName(), $valueCoordinates, $e->getMessage());
191-
$deferred->reject($batchGeocoded->newInstance());
191+
$deferred->resolve($batchGeocoded->newInstance());
192192
}
193193

194194
return $deferred->promise();
@@ -212,7 +212,7 @@ public function reverse($coordinates)
212212
}
213213
} catch (\Exception $e) {
214214
$batchGeocoded = new BatchResult($provider->getName(), $valueCoordinates, $e->getMessage());
215-
$deferred->reject($batchGeocoded->newInstance());
215+
$deferred->resolve($batchGeocoded->newInstance());
216216
}
217217

218218
return $deferred->promise();

src/CLI/GeotoolsApplication.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function getHelp(): string
4444
/**
4545
* {@inheritdoc}
4646
*/
47-
public function run(InputInterface $input = null, OutputInterface $output = null): int
47+
public function run(?InputInterface $input = null, ?OutputInterface $output = null): int
4848
{
4949
return parent::run($input, new ConsoleOutput);
5050
}

src/Coordinate/Coordinate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ class Coordinate implements CoordinateInterface, \JsonSerializable
5454
* Set the latitude and the longitude of the coordinates into an selected ellipsoid.
5555
*
5656
* @param Location|array|string $coordinates The coordinates.
57-
* @param Ellipsoid $ellipsoid The selected ellipsoid (WGS84 by default).
57+
* @param Ellipsoid|null $ellipsoid The selected ellipsoid (WGS84 by default).
5858
*
5959
* @throws InvalidArgumentException
6060
*/
61-
public function __construct($coordinates, Ellipsoid $ellipsoid = null)
61+
public function __construct($coordinates, ?Ellipsoid $ellipsoid = null)
6262
{
6363
if ($coordinates instanceof Location) {
6464
if (null !== $locationCoordinates = $coordinates->getCoordinates()) {

src/Coordinate/CoordinateCollection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ class CoordinateCollection extends ArrayCollection
2828
* CoordinateCollection constructor.
2929
*
3030
* @param CoordinateInterface[] $coordinates
31-
* @param Ellipsoid $ellipsoid
31+
* @param ?Ellipsoid $ellipsoid
3232
*/
33-
public function __construct(array $coordinates = array(), Ellipsoid $ellipsoid = null)
33+
public function __construct(array $coordinates = array(), ?Ellipsoid $ellipsoid = null)
3434
{
3535
if ($ellipsoid) {
3636
$this->ellipsoid = $ellipsoid;

src/GeometryCollection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ abstract class GeometryCollection extends ArrayCollection implements GeometryInt
3737
* CoordinateCollection constructor.
3838
*
3939
* @param GeometryInterface[] $geometries
40-
* @param Ellipsoid $ellipsoid
40+
* @param ?Ellipsoid $ellipsoid
4141
*/
42-
public function __construct(array $geometries = array(), Ellipsoid $ellipsoid = null)
42+
public function __construct(array $geometries = array(), ?Ellipsoid $ellipsoid = null)
4343
{
4444
$this->precision = -1;
4545

src/Polygon/Polygon.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ public function get($key)
383383
/**
384384
* {@inheritDoc}
385385
*/
386-
public function set($key, CoordinateInterface $coordinate = null)
386+
public function set($key, ?CoordinateInterface $coordinate = null)
387387
{
388388
if (is_array($key)) {
389389
$values = $key;

tests/TestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ protected function getStubCoordinate($lat = null, $lng = null)
113113

114114
/**
115115
* @param array $coordinate
116-
* @param Ellipsoid $ellipsoid
116+
* @param ?Ellipsoid $ellipsoid
117117
*
118118
* @return CoordinateInterface
119119
*/
120-
protected function getMockCoordinateReturns(array $coordinate, Ellipsoid $ellipsoid = null)
120+
protected function getMockCoordinateReturns(array $coordinate, ?Ellipsoid $ellipsoid = null)
121121
{
122122
$mock = $this->createMock('\League\Geotools\Coordinate\CoordinateInterface');
123123
$mock

0 commit comments

Comments
 (0)