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 compatibility with phan #7363

Merged
merged 2 commits into from
Sep 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions lib/Doctrine/ORM/Query/Expr.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ class Expr
* // (u.type = ?1) AND (u.role = ?2)
* $expr->andX($expr->eq('u.type', ':1'), $expr->eq('u.role', ':2'));
*
* @param \Doctrine\ORM\Query\Expr\Comparison |
* \Doctrine\ORM\Query\Expr\Func |
* \Doctrine\ORM\Query\Expr\Orx
* $x Optional clause. Defaults to null, but requires at least one defined when converting to string.
* @param Expr\Comparison|Expr\Func|Expr\Orx $x Optional clause. Defaults to null, but requires at least one
* defined when converting to string.
*
* @return Expr\Andx
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Query/Expr/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ abstract class Base
protected $parts = [];

/**
* @param array $args
* @param mixed $args
Copy link
Member

Choose a reason for hiding this comment

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

Probably mixed[]?

Copy link

@barbudreadmon barbudreadmon Aug 21, 2018

Choose a reason for hiding this comment

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

See https://github.com/doctrine/doctrine2/blob/68718eac1ba1f4804aa68ad57fb2be7583137c68/lib/Doctrine/ORM/Query/Expr.php#L604
A string is sent to the constructor, i don't think mixed[] accepts a string, and i know phan will trigger an error with it (i took a look at doctrine 3.0 before writing this PR).

Copy link
Member

Choose a reason for hiding this comment

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

the Base class indeed does not enforce passing an array to addMultiple (and so to the constructor), as it will cast it (which will wrap scalars into an array containing them)

*/
public function __construct($args = [])
{
Expand Down