Closed Harfusha closed 9 months ago
Array shape isnt fully supperted yet afaik But it should still work and not create a 2nd line for the same variable.
What version of the plugin are you using? And what is the code for $args here?
I wonder which part adds the extra line I made a test case https://github.com/dereuromark/cakephp-ide-helper/pull/344 and it seems to pass, so I cannot find an issue here.
We need to check your concrete code snippet.
Ah, look at that: https://github.com/dereuromark/cakephp-ide-helper/pull/344/commits/587ea0dec2b86f25ce0404ae01193d53417e50d6 Adding a more complex type inside the shape and things start to fail..
So thats the part that isnt yet supported, primitive ones currently already work.
$content = mb_substr($content, mb_strlen($typeString) + 1);
seems to be the problem, in this case making it
(int) 3 => object(IdeHelper\Annotation\VariableAnnotation) id:3 {
protected variable => 'haped'
protected description => ''
protected guessed => false
protected type => 'array{a: int, b: (string|null)}|null'
protected index => (int) 29
protected isInUse => false
}
cutting of the variable
Quick for now is to use normalized form
array{h: (string|int|null)]|null $args
the phpdoc tool returns after parsing.
I fixed up the PR, please let me know if this fixes it for you.
When variable have complex type like $args in screenshot then command
bin/cake annotate templates
is adding duplicated entry