dereuromark / cakephp-ide-helper

IDE Helper plugin for CakePHP
MIT License
186 stars 39 forks source link

Cake5: `fetchTable()` does not automatically result in a property #317

Closed LordSimal closed 1 year ago

LordSimal commented 1 year ago

Currently bin/cake annotate controllers will add

@property \Queue\Model\Table\QueuedJobsTable $QueuedJobs

to the controller class phpdocs just if this is called.

$queuedJobsTable = $this->fetchTable('Queue.QueuedJobs');

But this should only happen if a property is actually set, not just a variable to hold the table instance.

dereuromark commented 1 year ago

Should be doable checking the line as a whole for

$this->QueuedJobs = $this->fetchTable('Queue.QueuedJobs');

etc

LordSimal commented 1 year ago

well the property name could be anything so we should keep that in mind as well.

dereuromark commented 1 year ago

I am fine with only supporting conventions out of the Box If u deviate you can also write a custom task.