Closed klesun closed 4 years ago
Ok, so this is the issue and not my database connection or something like that...
I use this type of "hack" everywhere and it seems to be broken (likely because of this issue 😉 )
Glad to see you picked it up already.
yeah, sorry about that, will fix as soon as I get a bit of free time
You saved me lots of time and possible bugs already, I'll manage until then :D
On 14 Jan 2020, at 15:51, Artur Klesun notifications@github.com wrote:
yeah, sorry about that, will fix as soon as I get a bit of free time
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/klesun/deep-assoc-completion/issues/134?email_source=notifications&email_token=AANGKCXG23W7ZDME2QZNYXLQ5XGOTA5CNFSM4KC6R26KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEI44ABY#issuecomment-574210055, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANGKCXLVFC6VGDU2PCINNDQ5XGOTANCNFSM4KC6R26A.
Seems that the following is not working for me anymore as well:
/**
* Dockblock
* @return array [ ['bar' => 'foo'] ]
*/
public function foo() {
return $this->bar('foo');
}
Not sure if it's related.
Fix for the @method
issue released in 2020.01.15.001
@bravoman, could you, please, give a bit more context to the @return array []
use case? Should the completion be provided in the $this->bar('')
string argument? What is the implementation of the $this->bar
then?
Did you mean something like this, per chance?
Or like this?
The first one.
Does it work now? (the fix supposedly should not have affected the @return
tag, but still...)
If it still does not work, could you, please file a separate issue with minimal reproducible case and your phpstorm version?
Btw, as a side note, relating your "hack" for db table completion, you may find this helpful - you can type @method array getById(int $id) = Magic::dbRow('my_table')
instead of @method array getById(int $id) = (new \PDO())->query('SELECT * FROM my_table')->fetch(\PDO::FETCH_ASSOC)
Does it work now? (the fix supposedly should not have affected the
@return
tag, but still...)
Works! But it turns out I had an error in my docblock code. Forgot the @ before return 😬 🤦♂
You can close this issue.
Btw, as a side note, relating your "hack" for db table completion, you may find this helpful - you can type
@method array getById(int $id) = Magic::dbRow('my_table')
instead of@method array getById(int $id) = (new \PDO())->query('SELECT * FROM my_table')->fetch(\PDO::FETCH_ASSOC)
That's awesome! Seems like something for the Readme.md so everyone can use this 👍
Hence the syntax tree structure got changed: