users icon indicating copy to clipboard operation
users copied to clipboard

Missing Table generic definitions

Open LordSimal opened this issue 9 months ago • 0 comments

E.g. if one has an overwriten/custom CakeDC\Users\Model\Table\UsersTable class the IDE Helper Plugin will inject

 * @extends \CakeDC\Users\Model\Table\UsersTable<array{SunlimeEncryption: \App\Model\Behavior\SunlimeEncryptionBehavior, Timestamp: \Cake\ORM\Behavior\TimestampBehavior}>

which does not work for stan since it reports

 ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  Line   plugins/AlfredStaffMembers/src/Model/Table/StaffMembersTable.php                                                                                                                                                                     
 ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  62     PHPDoc tag @extends contains generic type CakeDC\Users\Model\Table\UsersTable<array<string, App\Model\Behavior\SunlimeEncryptionBehavior|Cake\ORM\Behavior\TimestampBehavior>> but class CakeDC\Users\Model\Table\UsersTable is not  
         generic.                                                                                                                                                                                                                             
         🪪  generics.notGeneric                                                                                                                                                                                                              
 ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 

Not sure what the syntax is, but the generics TBehaviors needs to be passed down to the base Cake\ORM\Table class.

Refs: https://github.com/cakephp/cakephp/pull/18323

LordSimal avatar May 03 '25 11:05 LordSimal