Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions src/Type/ObjectShapeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
return TrinaryLogic::createNo();
}

if (in_array($propertyName, $this->optionalProperties, true)) {
if ($this->isOptionalProperty($propertyName)) {
return TrinaryLogic::createMaybe();
}

Expand All @@ -122,6 +122,11 @@
);
}

public function isOptionalProperty(string $property): bool
{
return in_array($property, $this->optionalProperties, true);
}

public function accepts(Type $type, bool $strictTypes): AcceptsResult
{
if ($type instanceof CompoundType) {
Expand Down Expand Up @@ -156,24 +161,24 @@
],
);
if ($hasProperty->no()) {
if (in_array($propertyName, $this->optionalProperties, true)) {
if ($this->isOptionalProperty($propertyName)) {

Check failure on line 164 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 164 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.3)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 164 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.2)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 164 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 164 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.4)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 164 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 164 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 164 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.5)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 164 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 164 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 164 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 164 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 164 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 164 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 164 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 164 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.
continue;
}
$result = $result->and($hasProperty);
continue;
}
if ($hasProperty->maybe()) {
if (!in_array($propertyName, $this->optionalProperties, true)) {
if (!$this->isOptionalProperty($propertyName)) {

Check failure on line 171 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 171 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.3)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 171 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.2)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 171 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 171 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.4)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 171 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 171 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 171 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.5)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 171 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 171 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 171 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 171 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 171 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 171 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 171 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 171 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.
$result = $result->and($hasProperty);
continue;

Check failure on line 174 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 174 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.
}

$hasProperty = AcceptsResult::createYes();
}

$result = $result->and($hasProperty);
try {

Check failure on line 181 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 181 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.
$otherProperty = $type->getProperty((string) $propertyName, $scope);
} catch (MissingPropertyFromReflectionException) {
return AcceptsResult::createNo(
Expand Down Expand Up @@ -262,24 +267,24 @@
foreach ($this->properties as $propertyName => $propertyType) {
$hasProperty = new IsSuperTypeOfResult($type->hasProperty((string) $propertyName), []);
if ($hasProperty->no()) {
if (in_array($propertyName, $this->optionalProperties, true)) {
if ($this->isOptionalProperty($propertyName)) {

Check failure on line 270 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 270 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.3)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 270 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.2)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 270 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 270 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.4)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 270 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 270 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 270 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.5)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 270 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 270 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 270 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 270 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 270 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 270 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 270 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 270 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.
continue;
}
$result = $result->and($hasProperty);
continue;
}
if ($hasProperty->maybe()) {
if (!in_array($propertyName, $this->optionalProperties, true)) {
if (!$this->isOptionalProperty($propertyName)) {

Check failure on line 277 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 277 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.3)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 277 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.2)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 277 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 277 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.4)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 277 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 277 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 277 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.5)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 277 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 277 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 277 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 277 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 277 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 277 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 277 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 277 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.
$result = $result->and($hasProperty);
continue;
}

Check failure on line 280 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 280 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

$hasProperty = IsSuperTypeOfResult::createYes();
}

$result = $result->and($hasProperty);
try {
$otherProperty = $type->getProperty((string) $propertyName, $scope);

Check failure on line 287 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 287 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.
} catch (MissingPropertyFromReflectionException) {
return IsSuperTypeOfResult::createNo(
[
Expand Down Expand Up @@ -339,7 +344,7 @@
}

foreach ($this->optionalProperties as $name) {
if (in_array($name, $type->optionalProperties, true)) {
if ($type->isOptionalProperty($name)) {

Check failure on line 347 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 347 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.3)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 347 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.2)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 347 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 347 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.4)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 347 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 347 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 347 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.5)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 347 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 347 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 347 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 347 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 347 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 347 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 347 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 347 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.
continue;
}

Expand All @@ -349,7 +354,7 @@
return true;
}

public function tryRemove(Type $typeToRemove): ?Type

Check failure on line 357 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 357 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.
{
if ($typeToRemove instanceof HasPropertyType) {
$properties = $this->properties;
Expand Down Expand Up @@ -526,7 +531,7 @@
}
$items[] = new ObjectShapeItemNode(
$keyNode,
in_array($name, $this->optionalProperties, true),
$this->isOptionalProperty($name),

Check failure on line 534 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 534 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.3)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 534 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.2)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 534 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 534 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.4)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 534 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 534 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 534 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan with result cache (8.5)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 534 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 534 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, ubuntu-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 534 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 534 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.5, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 534 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.4, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 534 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 534 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.

Check failure on line 534 in src/Type/ObjectShapeType.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1, windows-latest)

Parameter #1 $property of method PHPStan\Type\ObjectShapeType::isOptionalProperty() expects string, int|string given.
$type->toPhpDocNode(),
);
}
Expand All @@ -536,2 +541,2 @@

}
Loading