Skip to content

Conversation

@DAGpro
Copy link

@DAGpro DAGpro commented Nov 22, 2025

Fix psalm errors if groupBy() is called before or without calling buildQuery()

$this->select()
    ->groupBy('[email protected]_id')
    ->groupBy('label')
    ->buildQuery()
    ->columns(['label', 'count(*) count']);

Copy link
Member

@roxblnfk roxblnfk left a comment

Choose a reason for hiding this comment

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

Hello.

At first glance, your change seems valid: Select proxies methods into Query Builder, including groupBy.

However, from the ORM's perspective, this is not normal usage. Calling Select::groupBy without going down to the lower level (to Query Builder) can disrupt the ORM's logic. This method is intentionally hidden from use in ORM.

That's why I cant apply the changes.

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