Remove redundant phpstan param from DriverManager::getConnection()#4403
Remove redundant phpstan param from DriverManager::getConnection()#4403morozov merged 1 commit intodoctrine:2.12.xfrom
Conversation
IIRC that was the goal, it did not understand the annotations I added when I added them. Glad to see that has been fixed :) |
Sounds legit, I also often type differently for psalm and phpstan |
|
Thanks, @simPod. Please squash and double-check if the same will work on |
This effectively prevented phpstan from inferring type of `T` template. > Unable to resolve the template type T in call to method static method Doctrine\DBAL\DriverManager::getConnection()
|
There are some errors but I'd rather fix them individually on each branch. |
It doesn't work this way. We regularly merge the changes from the older branch up to |
|
FYI: I reverted it during the merge of This change opens a can of worms: the connection parameters array contains a lot of different keys of different types which may or may not be used in certain scenarios. The |
I agree, if I was the one who introduced it I'd definitely list all possible keys.
Should I do something? Not sure what it implies. |
If only it was that easy :-) There are quite a lot of keys in the connection parameters, and while Psalm allows specifying named array types, it doesn't allow sharing them across files. See some WIP for example: 3.0.x...morozov:psalm-params.
It was just a note for your information. |
@morozov Psalm allows import and reuse them - please see https://psalm.dev/docs/annotating_code/supported_annotations/#psalm-import-type |
|
@andrew-demb that's new to me. Thanks for the pointer! |
Release [2.12.1](https://github.com/doctrine/dbal/milestone/84) 2.12.1 ====== - Total issues resolved: **2** - Total pull requests resolved: **11** - Total contributors: **7** Documentation,Prepared Statements --------------------------------- - [4424: Mark SQLParserUtils internal](doctrine#4424) thanks to @morozov Packaging --------- - [4416: Update .gitattributes](doctrine#4416) thanks to @bytestream Bug,Cache --------- - [4414: ResultCacheStatement::fetchAllAssociative does not store results in cache](doctrine#4414) thanks to @morozov and @dFayet Deprecation,Prepared Statements ------------------------------- - [4411: Deprecate inappropriate usage of prepared statement parameters](doctrine#4411) thanks to @morozov - [4407: Deprecate colon prefix for prepared statement parameters](doctrine#4407) thanks to @morozov Static Analysis --------------- - [4403: Remove redundant phpstan param from DriverManager::getConnection()](doctrine#4403) thanks to @simPod Bug,Locking,Transactions ------------------------ - [4400: LockMode::NONE should not set WITH (NOLOCK)](doctrine#4400) thanks to @BenMorel Code Style,PHP -------------- - [4398: Update PHP&doctrine#95;CodeSniffer to 3.5.8](doctrine#4398) thanks to @morozov PDO,PHP,Test Suite ------------------ - [4396: Fix php8 mysql mariadb](doctrine#4396) thanks to @greg0ire Documentation ------------- - [4390: Fix headline in the upgrade docs](doctrine#4390) thanks to @jdreesen Documentation,Testing --------------------- - [4356: Testing Guidelines](doctrine#4356) thanks to @morozov # gpg: Signature made Sat Nov 14 21:50:01 2020 # gpg: using DSA key 1BEDEE0A820BC30D858F9F0C2C3A645671828132 # gpg: Can't check signature: No public key # Conflicts: # README.md
Summary
This effectively prevented phpstan from inferring type of
Ttemplate.