Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix types on ResultSetMapping #9621

Merged
merged 1 commit into from
Apr 4, 2022

Conversation

derrabus
Copy link
Member

This PR prepares #9620 on the 2.12.x branch.

@derrabus derrabus added this to the 2.12.0 milestone Mar 31, 2022
* @param string $alias The result alias with which the scalar result should be placed in the result structure.
* @param string $type The column type
* @param string $columnName The name of the column in the SQL result set.
* @param string|int $alias The result alias with which the scalar result should be placed in the result structure.
Copy link
Member Author

@derrabus derrabus Mar 31, 2022

Choose a reason for hiding this comment

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

I'm widening the type here because we pass an integer in this line:

$this->rsm->addScalarResult($columnAlias, $resultAlias, $fieldType);

The $resultAlias is definitely an int as we can see here:

$resultAlias = $this->scalarResultCounter++;

An alternative approach would be to cast the integer to a string.

@derrabus derrabus merged commit 0e9c753 into doctrine:2.12.x Apr 4, 2022
@derrabus derrabus deleted the types/rsm-backports branch April 4, 2022 19:58
derrabus added a commit to derrabus/orm that referenced this pull request Apr 4, 2022
* 2.12.x:
  Fix types on ResultSetMapping (doctrine#9621)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants