Skip to content

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