PDOStatement conditional fetch/fetchAll return values#1882
PDOStatement conditional fetch/fetchAll return values#1882Anders Jenbo (AJenbo) wants to merge 2 commits into
Conversation
| * all cases, <b>FALSE</b> is returned on failure. | ||
| * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true. | ||
| * | ||
| * @return ($mode is PDO::FETCH_ASSOC ? array<string, mixed>|false |
There was a problem hiding this comment.
It seems wrong to have two @return tags inside one PhpDoc. It would be better to use different tag like @psalm-return or @phpstan-return. Or just remove the old @return tag
There was a problem hiding this comment.
I totally missed that, thanks.
I went with the @phpstan-return option since the conditions is already a fairly big block tacking a long comment at the end seems a bit much.
There was a problem hiding this comment.
I suggest copying it for psalm (to avoid preferential treatment) and having a simplified @return for e.g. phpstorm.
I also had the same type of failure with those changes and solved it in my PR here: https://github.com/JetBrains/phpstorm-stubs/pull/1810/changes#diff-41a14d60208b4270d5d5d096abca3eb48024718babf786e207c3ab54592000a8R270 (tests/StubsPhpDocTest.php)
There was a problem hiding this comment.
I suggest copying it for psalm
you should give it a test in psalm before. IIRC psalm (and also PHPStan) pick the others phpdoc (in case no more tools-specific phpdoc exists). so the PR as is, might already work for psalm
There was a problem hiding this comment.
I know they support each other, my concern is more about preferential treatment... Unless the project owners consciously decide to go for one tool and not the other officially, we might end up with different contributions using either tool (inconsistently).
|
Hi Anders Jenbo (@AJenbo) , сould you please mark this PR as ready for review? It's currently in draft state, which prevents us from merging it |
|
Gleb Sieemshchikov (@LolGleb) there are at least two remaining open points:
Then there's the point about having |
0c286dd to
0816f1c
Compare
|
Wow can't belive this was almost a month ago, sorry for the long wait I have just been insanely busy with other things thinking I was going to update this one at the end of the day or next day repeatedly. Well it's done now, except for uuf6429's point 2 which i find contradicts the note about having both the complicated logic and very long comment split appart. |
No description provided.