Skip to content

Fix up template annotation. #18351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2025
Merged

Fix up template annotation. #18351

merged 1 commit into from
Apr 18, 2025

Conversation

dereuromark
Copy link
Member

Follow #18323

This defaulting seems like a good idea to prevent everyone having to do
dereuromark/cakephp-ide-helper@c2a732f
everywhere

Refs phpstan/phpstan#12868 (reply in thread)

@@ -155,7 +155,7 @@
*
* @see \Cake\Event\EventManager for reference on the events system.
* @link https://book.cakephp.org/5/en/orm/table-objects.html#event-list
* @template TBehaviors of array<string, \Cake\ORM\Behavior>
* @template TBehaviors of array<string, \Cake\ORM\Behavior> = array{}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't seen such syntax anywhere. Can you point to some doc?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the refered phpstan link where he himself explains it.
I just tested it and it works, also added it to my extended models
dereuromark/cakephp-shim@7baa2a1
As apparently templates are not properly extended, so those need to be defined on every extension level

But then my latest change dereuromark/cakephp-ide-helper@ea3f166
makes it fully work :)

@markstory markstory merged commit a9c2c30 into 5.x Apr 18, 2025
13 checks passed
@markstory markstory deleted the 5.x-template-tbehavior branch April 18, 2025 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants