Skip to content
Snippets Groups Projects
Commit c91231d1 authored by Daniel Kurowski's avatar Daniel Kurowski
Browse files

Reconstitute: set array shape in method body instead of signature (because of...

Reconstitute: set array shape in method body instead of signature (because of phpstan strict rules compatibility)
parent 612e6bfc
No related branches found
No related tags found
1 merge request!17Reconstitute: set array shape in method body instead of signature (because of...
Pipeline #36862 passed
...@@ -33,7 +33,7 @@ final class ReconstituteConstructor implements Capability ...@@ -33,7 +33,7 @@ final class ReconstituteConstructor implements Capability
$literals[] = new PhpLiteral("\$values['" . $name . "']"); $literals[] = new PhpLiteral("\$values['" . $name . "']");
} }
$reconstitute->addComment(\sprintf('@param array{%s} $values', \implode(', ', $shapeFields))); $reconstitute->addBody(\sprintf('/** @var array{%s} $values */', \implode(', ', $shapeFields)));
$reconstitute->addBody("return new static(...?);", [$literals]); $reconstitute->addBody("return new static(...?);", [$literals]);
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment