-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Properly format value in UniqueEntityValidator #20287
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
Properly format value in UniqueEntityValidator #20287
Conversation
d57df0d
to
3d1fc75
Compare
* This software consists of voluntary contributions made by many individuals | ||
* and is licensed under the MIT license. For more information, see | ||
* <http://www.doctrine-project.org>. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong license header :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops ;)
3d1fc75
to
9f9720e
Compare
* @return EntityManager | ||
*/ | ||
public static function createTestEntityManager() | ||
public static function createTestEntityManager(\Doctrine\ORM\Configuration $config = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a use
statement instead of using the FQCN (same in the docblock then)
{ | ||
if (!extension_loaded('pdo_sqlite')) { | ||
\PHPUnit_Framework_TestCase::markTestSkipped('Extension pdo_sqlite is required.'); | ||
} | ||
|
||
if ($config === null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
null === $config
9f9720e
to
ed0d3fe
Compare
@xabbuh done! |
/** | ||
* The list of EntityRepository instances. | ||
* | ||
* @var \Doctrine\Common\Persistence\ObjectRepository[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned by @xabbuh, you should use a use statement instead of using the FQCN (there are other occurrences in your patch).
/** | ||
* Create a new repository instance for an entity class. | ||
* | ||
* @param \Doctrine\ORM\EntityManagerInterface $entityManager The EntityManager instance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the phpdoc does not add any value, it should be removed, which is the case here and the same goes for the next one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand correctly. Do you mean the method description, parameter description or both?
ed0d3fe
to
9043a55
Compare
Thank you @alcaeus. |
This PR was merged into the 3.1 branch. Discussion ---------- Properly format value in UniqueEntityValidator | Q | A | | --- | --- | | Branch? | 3.1 | | Bug fix? | yes | | New feature? | no | | BC breaks? | no | | Deprecations? | no | | Tests pass? | yes | | Fixed tickets | / | | License | MIT | This PR fixes a small issue introduced in #15279. Having an array in a field considered for a unique check causes an array to string conversion error in the translator. This can be avoided by formatting the value parameter with `formatValue`. Commits ------- 9043a55 Properly format value in UniqueEntityValidator
This PR fixes a small issue introduced in #15279. Having an array in a field considered for a unique check causes an array to string conversion error in the translator. This can be avoided by formatting the value parameter with
formatValue
.