Skip to content

Commit 3743339

Browse files
committed
fix phpstan
1 parent fe1a3cb commit 3743339

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

phpstan.neon

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ parameters:
2020
path: tests/*.php
2121
-
2222
identifier: missingType.generics
23+
-
24+
identifier: method.nonObject
25+
-
26+
identifier: varTag.nativeType
2327

2428
level: max
25-
checkMissingIterableValueType: true

src/Objects/Geometry.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public function toWkb(): string
5959
// @phpstan-ignore-next-line
6060
$wkbWithoutSrid = (new geoPHPWkb)->write($geoPHPGeometry);
6161

62+
// @phpstan-ignore-next-line binaryOp.invalid
6263
return $sridInBinary.$wkbWithoutSrid;
6364
}
6465

@@ -76,6 +77,7 @@ public static function fromWkb(string $wkb): static
7677
$wkb = substr($wkb, 4);
7778

7879
$geometry = Factory::parse($wkb);
80+
// @phpstan-ignore-next-line assign.propertyType
7981
$geometry->srid = $srid;
8082
}
8183

src/Objects/GeometryCollection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ protected function validateGeometriesCount(): void
155155
protected function validateGeometriesType(): void
156156
{
157157
$this->geometries->each(function (mixed $geometry): void {
158-
/** @var mixed $geometry */
158+
// @phpstan-ignore-next-line function.alreadyNarrowedType
159159
if (! is_object($geometry) || ! ($geometry instanceof $this->collectionOf)) {
160160
throw new InvalidArgumentException(
161161
sprintf('%s must be a collection of %s', static::class, $this->collectionOf)
@@ -169,6 +169,7 @@ protected function validateGeometriesType(): void
169169
*/
170170
private function isExtended(): bool
171171
{
172+
// @phpstan-ignore-next-line function.alreadyNarrowedType
172173
return is_subclass_of(static::class, self::class);
173174
}
174175
}

0 commit comments

Comments
 (0)