dereuromark / cakephp-ide-helper

IDE Helper plugin for CakePHP
MIT License
186 stars 39 forks source link

Complex type, that exists in property is added again #354

Closed Harfusha closed 1 month ago

Harfusha commented 3 months ago

I have this property on entity. @property array{user: int, account: string|null, newContacts: array<mixed>|null}|null $data

When i run annotator same property is added again on the end. @property array|null $data

image

dereuromark commented 3 months ago

Cake5?

Harfusha commented 3 months ago

Cakephp 4, sorry forgot to mention this :D

dereuromark commented 2 months ago

This is fixed in 5 afaik You an check if things can be backported

Harfusha commented 2 months ago

But it is already backported https://github.com/dereuromark/cakephp-ide-helper/pull/348/commits/e212e9f9bdb0712edd5164b2522c4abddfa1ae5f

dereuromark commented 2 months ago

Whats the problem then? Any idea?

dereuromark commented 2 months ago

And does the same happen in 5.x? Then it is maybe a phpstan Parser issue

Harfusha commented 2 months ago

Will try to write some tests next week for cake 4 and 5

dereuromark commented 1 month ago

Any update regarding this issue?

Harfusha commented 1 month ago

i had no time to do this. I hope i will find some time this week

dereuromark commented 1 month ago
$pieces = explode(' ', $tokens[$i + 2]['content']);

The Illuminator code uses basic explode() instead of more sophistacted phpstan docblock parsing This would have to be ported from the annotator code it seems.

The workaround until then seems to be to not use any whitespace, then it should work as is.

dereuromark commented 1 month ago

If there is still something weird, we can reopen, add more tests and hopefully another fix.