Skip to content

Fix AbstractQuery::setParameter phpdoc#9504

Merged
derrabus merged 2 commits intodoctrine:2.11.xfrom
dmaicher:patch-1
Feb 12, 2022
Merged

Fix AbstractQuery::setParameter phpdoc#9504
derrabus merged 2 commits intodoctrine:2.11.xfrom
dmaicher:patch-1

Conversation

@dmaicher
Copy link
Contributor

@dmaicher dmaicher commented Feb 11, 2022

This can be Connection::PARAM_INT_ARRAY or Connection::PARAM_STR_ARRAY for example and those are int

@dmaicher dmaicher marked this pull request as ready for review February 11, 2022 15:33
* strings and numeric types.
* @param string|int $key The parameter position or name.
* @param mixed $value The parameter value.
* @param string|int|null $type The parameter type. If specified, the given value will be run through
Copy link
Member

Choose a reason for hiding this comment

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

Should we make this more precise?

Suggested change
* @param string|int|null $type The parameter type. If specified, the given value will be run through
* @param string|Connection::PARAM_*|ParameterType::*|null $type The parameter type. If specified, the given value will be run through

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is that something IDE's and static analyzers understand? 🤔

Copy link
Member

Choose a reason for hiding this comment

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

Static analyzers, yes. IDE, I don't know (I use neovim). Please test if you can.

Copy link
Member

Choose a reason for hiding this comment

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

AFAIK, we use this kind of literal type syntax only in annotations with psalm- vendor prefix, e.g. @psalm-param in this case.

Copy link
Member

Choose a reason for hiding this comment

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

Anyway, let's not go down that road in a bugfix PR.

@derrabus derrabus added this to the 2.11.2 milestone Feb 12, 2022
@derrabus derrabus merged commit 599832c into doctrine:2.11.x Feb 12, 2022
@dmaicher dmaicher deleted the patch-1 branch February 13, 2022 07:56
derrabus added a commit that referenced this pull request Feb 13, 2022
* 2.11.x:
  Fix AbstractQuery::setParameter phpdoc (#9504)
derrabus added a commit to derrabus/orm that referenced this pull request Feb 14, 2022
* 2.12.x:
  Fix types on caches (doctrine#9507)
  Fix AbstractQuery::setParameter phpdoc (doctrine#9504)
  Added "false" value to $columnPrefix type declaration. (doctrine#9493)
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.

3 participants