1.18.0
Improvements
PHP docblock parsing is now using PHPStan's functionality.
This allows for more complex types, e.g. generics (array<int, int>
), to be recognized and handled.
Note: The old alternative of @property \Cake\Controller\Component\SecurityComponent Security
is now not working anymore, always needs a $ in front of property name now to be found as existing annotation (@property \Cake\Controller\Component\SecurityComponent $Security
).
Also, added config objectAsGenerics
(default false) allows to control the object collection annotations.
It seems IDEs (e.g. PHPStorm) are not able to handle those yet, specifically inside templates. See this for details.
It completes the existing arrayAsGenerics
config which now only handles simple arrays.
It is recommended to use config 'templateCollectionObject' => 'iterable'
here for templates if you are not passing your collections always as arrays.
Example config:
'arrayAsGenerics' => true,
'objectAsGenerics' => true,
'templateCollectionObject' => 'iterable',