Skip to content

Commit

Permalink
resolve some PHPStan issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Péter Báthory committed Apr 15, 2020
1 parent 66c1733 commit 848f4f4
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 20 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,10 @@ jobs:
- stage: Test
php: 7.4

- stage: Allowed Failures
- php: nightly

# FIXME: allow_failures doesn't appear to work with stages defined. How to solve that?
allow_failures:
- stage: Allowed Failures
- php: nightly

fast_finish: true
Expand Down
15 changes: 0 additions & 15 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ parameters:
count: 1
path: src/Adapter/GeoRSS.php

-
message: "#^Call to function is_array\\(\\) with string will always evaluate to false\\.$#"
count: 1
path: src/Adapter/GoogleGeocode.php

-
message: "#^Method geoPHP\\\\Adapter\\\\GoogleGeocode\\:\\:read\\(\\) should return geoPHP\\\\Geometry\\\\Geometry but returns null\\.$#"
count: 1
Expand Down Expand Up @@ -270,16 +265,6 @@ parameters:
count: 1
path: src/Geometry/MultiPolygon.php

-
message: "#^Result of \\|\\| is always false\\.$#"
count: 1
path: src/Geometry/Point.php

-
message: "#^Return type \\(null\\) of method geoPHP\\\\Geometry\\\\Point\\:\\:explode\\(\\) should be compatible with return type \\(array\\<array\\<geoPHP\\\\Geometry\\\\Point\\>\\|geoPHP\\\\Geometry\\\\LineString\\>\\) of method geoPHP\\\\Geometry\\\\Geometry\\:\\:explode\\(\\)$#"
count: 1
path: src/Geometry/Point.php

-
message: "#^Parameter \\#2 \\$allowEmptyComponents of method geoPHP\\\\Geometry\\\\Surface\\:\\:__construct\\(\\) expects bool, null given\\.$#"
count: 1
Expand Down
3 changes: 2 additions & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ parameters:
- tests/unit
ignoreErrors:
- "#^Unsafe usage of new static\\(\\)\\.$#"
inferPrivatePropertyTypeFromConstructor: true
inferPrivatePropertyTypeFromConstructor: true
treatPhpDocTypesAsCertain: false
2 changes: 1 addition & 1 deletion src/Adapter/GoogleGeocode.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class GoogleGeocode implements GeoAdapter
/**
* Makes a geocoding (lat/lon lookup) with an address string or array geometry objects
*
* @param string $address Address to geocode
* @param string|string[] $address Address to geocode
* @param string $apiKey Your application's Google Maps Geocoding API key
* @param string $returnType Type of Geometry to return. Can either be 'points' or 'bounds' (polygon)
* @param array|bool|Geometry $bounds Limit the search area to within this region.
Expand Down
2 changes: 1 addition & 1 deletion src/Geometry/Geometry.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ abstract public function invertXY();
* Get all line segments
* @param bool $toArray return segments as LineString or array of start and end points. Explode(true) is faster
*
* @return LineString[] | Point[][]
* @return LineString[] | Point[][] | null
*/
abstract public function explode($toArray = false);

Expand Down

0 comments on commit 848f4f4

Please sign in to comment.