Skip to content

Conversation

@vaishnavyogesh
Copy link
Contributor

Description

The return type mismatches with the one mentioned in the doc-block.

    /**
     * @return array<int, \Prism\Prism\ValueObjects\ToolResult>
     */
    protected function aggregateToolResults(): array
    {
        return $this->steps
            ->flatMap(fn (Step $step): array => $step->toolResults)
            ->values()
            ->toArray();
    }

Changes

Replaced toArray() with all() to avoid arraying all the ToolResults.

Copy link
Contributor

@sixlive sixlive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@sixlive sixlive merged commit bc370c9 into prism-php:main Jan 26, 2026
14 checks passed
@vaishnavyogesh vaishnavyogesh deleted the fix/return-type-mismatch branch January 27, 2026 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants