In file /Drupal/Tests/Core/Database/Driver/pgsql/PostgresqlConnectionTest.php we have wrong usage of @return phpDoc with [].
Instead of '@return []' we need to use '@return array'.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | fix-phpdoc-return-2659412-4.patch | 1.7 KB | IRuslan |
Comments
Comment #2
IRuslan commentedComment #3
IRuslan commentedPatch in the attachment.
Comment #4
IRuslan commentedAlso noted same problem in core/modules/locale/src/PluralFormula.php.
Patch is updated.
Comment #6
IRuslan commentedComment #8
daffie commentedThe preferred way in Drupal for describing an array is with square brackets. So I am closing this issue.
@IRuslan: Thank you for your effort.
Comment #9
IRuslan commentedActually, I disagree.
If we search within core '@return []' - only usages from ConnectionTest.php will be found, while if you will search for '@return array' there are more than 1000 usages.
As a result, whole Core code written in '@return array' manner instead of '@return []'.
Comment #10
daffie commented@IRuslan: From the https://www.drupal.org/coding-standards/docs#types. I read the following:
So it used to be "array" and now squared brackets are preferred. Both are good. If you agree, we can close this issue.
Comment #11
IRuslan commentedOk, thanks for the link.
I just wanted to be consistent in Core:)
But I think there are a lot of more important issues to review.