-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
Between the extension and this polyfil, there is an inconsistency (I think, if I can read the C well enough) where the extension produces a new Vector from the merge method, but the polyfil uses the generic Sequence trait, which returns a Sequence.
This is causing some confusion with vimeo/psalm whose stubs must be created from the polyfil code. I get errors in psalm, and errors in tests depending on which way I set it.
For example:
private Vector $middlewares;
public function push(Middleware ...$middlewares): static
{
$this->middlewares = $this->middlewares->merge($middlewares);
return $this;
}This should work fine, but psalm errors.
This is my current workaround:
public function push(Middleware ...$middlewares): static
{
$new = $this->middlewares->merge($middlewares);
$this->middlewares = new Vector($new);
return $this;
}Metadata
Metadata
Assignees
Labels
No labels