NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist, #2702 most downloaded on Packagist
CakePHP IdeHelper Plugin to improve auto-completion
Latest stable
2.23.1
Last release 1 months ago
11 Oct 2026
Ships on a steady schedule
a new release about every 2 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
207 releases · first in 2017
Drag across the ruler to compare, or tap a release to open it.
Fixed skipping of abstract classes.
Fixed skipping of abstract classes.
This is the result when you run the annotator on an upgraded project or plugin: ```diff
For CakePHP 4.0+ apps.
Highlights:
This is the result when you run the annotator on an upgraded project or plugin:
--- a/src/Model/Table/UsersTable.php
+++ b/src/Model/Table/UsersTable.php
@@ -6,17 +6,22 @@
/**
* @mixin \Cake\ORM\Behavior\TimestampBehavior
* @property \App\Model\Table\RolesTable&\Cake\ORM\Association\BelongsTo $Roles
* @method \App\Model\Entity\User get($primaryKey, $options = [])
- * @method \App\Model\Entity\User newEntity($data = null, array $options = [])
+ * @method \App\Model\Entity\User newEntity(array $data, array $options = [])
* @method \App\Model\Entity\User[] newEntities(array $data, array $options = [])
* @method \App\Model\Entity\User|false save(\Cake\Datasource\EntityInterface $entity, $options = [])
* @method \App\Model\Entity\User patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
- * @method \App\Model\Entity\User[] patchEntities($entities, array $data, array $options = [])
- * @method \App\Model\Entity\User findOrCreate($search, callable $callback = null, $options = [])
+ * @method \App\Model\Entity\User[] patchEntities(iterable $entities, array $data, array $options = [])
+ * @method \App\Model\Entity\User findOrCreate($search, ?callable $callback = null, $options = [])
* @method \App\Model\Entity\User saveOrFail(\Cake\Datasource\EntityInterface $entity, $options = [])
+ * @method \App\Model\Entity\User newEmptyEntity()
+ * @method \App\Model\Entity\User[]|\Cake\Datasource\ResultSetInterface|false saveMany(iterable $entities, $options = [])
+ * @method \App\Model\Entity\User[]|\Cake\Datasource\ResultSetInterface saveManyOrFail(iterable $entities, $options = [])
+ * @method \App\Model\Entity\User[]|\Cake\Datasource\ResultSetInterface|false deleteMany(iterable $entities, $options = [])
+ * @method \App\Model\Entity\User[]|\Cake\Datasource\ResultSetInterface deleteManyOrFail(iterable $entities, $options = [])
*/
class UsersTable extends Table {
It contains the new 4.x path string autocomplete:
Your coding agent can read these notes before it upgrades. Set up the MCP server →
API should now be stable. Please test and give feedback.
API should now be stable. Please test and give feedback.
Please help to finalize for stable release.
Please help to finalize for stable release.
It already contains the new 4.x path string autocomplete:
Quick fixed an issue with directives
Backported fix of ControllerAnnotator working with prefixed controllers (e.g. Admin)
Backported fix of ControllerAnnotator working with prefixed controllers (e.g. Admin)
### Improvements Some backports to CakePHP 3.x
Some backports to CakePHP 3.x
Allow for custom project namespace (App).
Allow for custom project namespace (App).
### Bugfixes Small regression fix.
Small regression fix.
Fixed skipping of abstract classes.
Fixed skipping of abstract classes.
Added the saveMany() method to the Table annotations: ` @method \App\Model\Entity\BarBarsAbstract[]|\Cake\Datasource\ResultSetInterface|false saveMany
Added the saveMany() method to the Table annotations:
@method \App\Model\Entity\BarBarsAbstract[]|\Cake\Datasource\ResultSetInterface|false saveMany($entities, $options = [])
Also added newEmptyEntity() if Shim plugin is used and added new 3.9 methods already for once this minor is released and those methods become available.
Fixed hasOne() annotations for Entity classes to show nullable relation as |null in all cases.
Fixed hasOne() annotations for Entity classes to show nullable relation as |null in all cases.
Fixed Plugin AppControllers to be skipped for controller model annotation.
Fixed an unhandled notice on template parsing.
Fixed some small exceptions to not cause the whole generation to fail.
Added an improved IDE meta file generator, using value objects and now supporting all (new) directives:
Added an improved IDE meta file generator, using value objects and now supporting all (new) directives:
override() (already used a lot) for input+output couplingexpectedArguments() for argumentsexpectedReturnValues() for return valuesregisterArgumentsSet() as helperYou can now easily add tasks for any method you want to improve the typehinting/autocomplete for. See Generator (task) docs for details.
This is mainly for PHPStorm, as probably not many others support such a meta file.
Now not just bool true/false, but also the possible "magic strings" are typehinted and usable as single click/enter.
Make sure you upgrade custom generator tasks, and if you use Queue or other plugins that those also are updated to the matching new minor version there.
Removed false positives on the custom finder list for the IDE meta map. Now the finder autocomplete works for all valid custom finders found:
Removed false positives on the custom finder list for the IDE meta map. Now the finder autocomplete works for all valid custom finders found:
Fixed annotation handling around non-instantiable classes (abstract ones). Big thx to @dakota for his contribution.
Fixed a view more template annotation collecting issues.
Fixed a view more template annotation collecting issues.
Allow auto-collecting view template variables from (ctp/php) files. This has two key benefits:
Allow auto-collecting view template variables from (ctp/php) files. This has two key benefits:
This is how your template could currently look like:
This is what IdeHelper template annotator finds and displayes in dry-run output: Let's apply them for real (without -d).
After letting the annotator update the annotations the errors go away:
Allow @property-read tag to be used for virtual entity properties.
Allow @property-read tag to be used for virtual entity properties.
Fixed doc block finding for abstract classes.
Fixed doc block finding for abstract classes.
Add @uses annotations for magically/indirectly invoked test classes to quick-jump to the corresponding classes that are tested, mainly for Controller
Add @uses annotations for magically/indirectly invoked test classes to quick-jump to the corresponding classes that are tested, mainly for Controller and Command tests.
Added support for annotations in traits. So far this was only possible for classes.
Improve merging of default tasks for simple value-only case (numeric key) in configs.
Improve merging of default tasks for simple value-only case (numeric key) in configs.
Fixed controller annotator for model annotations. Thanks @dakota for the help here.
Fixed controller annotator for model annotations. Thanks @dakota for the help here.
### Bugfixes Fixed interface annotations.
Fixed interface annotations.
Allow customizing/extending native annotators.
Added CommandAnnotator for annotating commands and their loadModel() usage.
CommandAnnotator for annotating commands and their loadModel() usage.loadModel() calls that cannot be resolved to a concrete Table class to at least annotate the core fallback Table class.Allow -p PluginName to also work on non-loaded plugins. Before you had to load plugins before you could run this on them. But since many plugins do no
Allow -p PluginName to also work on non-loaded plugins. Before you had to load plugins before you could run this on them. But since many plugins do not need CakePHP plugin loading to work, this would be annoying.
Until this autoloading is supported in Core, IdeHelper shims this using its own App and Plugin class wrappers.
Fixed ordering for meta files and removed invalid class from there.
### Bugfixes Fixed saveOrFail() annotation.
Fixed saveOrFail() annotation.
Filter by search string in file name for EntityField Illuminator task.
Filter by search string in file name for EntityField Illuminator task.
Fixed edge cases for EntityField Illuminator task.
The Illuminator can modify your PHP files based on Illuminator rulesets. You can use the pre-set tasks, or create your own to enhance your PHP files a
The Illuminator can modify your PHP files based on Illuminator rulesets. You can use the pre-set tasks, or create your own to enhance your PHP files and classes.
Each task has its own scope defined, based on path or filename. If that doesnt match, it will be skipped.
bin/cake illuminator illuminate <path>
It ships with the following tasks:
Please add your ideas/improvements/tasks as issue or pull request.
Fixed virtual annotations to not duplicate when getter method (for lazyloading or as accessors) is present
Thanks to @dakota here!
Virtual entity properties are now supported in EntityAnnotator. Those added annotations can even be used in IDEs to "detect usage" of those inside the
Virtual entity properties are now supported in EntityAnnotator. Those added annotations can even be used in IDEs to "detect usage" of those inside the code for these virtual properties (get...() methods). So the annotations are really useful to keep in sync with your code.
An example can be found here.
Fixed inheritdoc usage to be less strict
Added plugins autocomplete for addPlugin() calls.
Added plugins autocomplete for addPlugin() calls.
Removed deprecations. Now CakePHP 3.7+
Added nullable information into Entity annotations.
Added nullable information into Entity annotations.
Before:
* @property \Cake\I18n\FrozenTime $completed
After (based on schema "Default NULL"):
* @property \Cake\I18n\FrozenTime|null $completed
Uses a whitelist for template extensions now. By default only ctp and php template files are processed and modified by TemplateAnnotator.
Uses a whitelist for template extensions now.
By default only ctp and php template files are processed and modified by TemplateAnnotator.
To adjust the template extensions being processed set IdeHelper.templateExtensions via Configure.
Fixed EntityAnnotator to not annotate non-existing entities. It will now fall back to the core generic one instead.
### Bugfixes Fixed HABTM through aliases.
Fixed HABTM through aliases.
Fixed the pivot relation from BelongsToMany to the correct one (HasMany):
Fixed the pivot relation from BelongsToMany to the correct one (HasMany):
* @property \App\Model\Table\FeaturesFeaturesTable|\Cake\ORM\Association\HasMany $FeaturesFeatures
* @property \App\Model\Table\FeaturesModulesTable|\Cake\ORM\Association\HasMany $FeaturesModules
*/
class FeaturesTable extends Table
HABTM is always 2x hasMany from the outside in and 2x belongsTo from the inside out.
For BelongsToMany relationships this will add typehinting/clickability for the pivot table and its Table class:
For BelongsToMany relationships this will add typehinting/clickability for the pivot table and its Table class:
// FeaturesTable
$this->belongsToMany('DependingFeatures', [
'foreignKey' => 'feature_id',
'className' => 'Features',
'targetForeignKey' => 'depending_feature_id',
'joinTable' => 'features_features',
'propertyName' => 'depending_features',
]);
$this->belongsToMany('Modules', [
'foreignKey' => 'feature_id',
'targetForeignKey' => 'module_id',
'through' => 'FeaturesModules',
'joinTable' => 'features_modules',
'propertyName' => 'modules',
]);
now adds
* @property \App\Model\Table\FeaturesFeaturesTable|\Cake\ORM\Association\HasMany $FeaturesFeatures
* @property \App\Model\Table\FeaturesModulesTable|\Cake\ORM\Association\HasMany $FeaturesModules
*/
class FeaturesTable extends Table
or at least basic Cake\ORM\Table class for chaining and querying on the pivot table as in
$this->Features->FeaturesModules->find()->contain(['Modules', 'Features']);
// or
$this->Features->FeaturesFeatures->find()->contain(['DependingFeatures', 'Features']);
Note one time through and one time auto-calculation alias.
Table behaviors and generic model code use the following signature: ```php /
Table behaviors and generic model code use the following signature:
/**
* @param \Cake\Event\Event $event Event
* @param \Cake\Datasource\EntityInterface $entity Entity
* @param \ArrayObject $options Options
* @return void
*/
public function beforeSave(Event $event, EntityInterface $entity, ArrayObject $options)
And as long you only use methods and attributes of the EntityInterface (as contracted here), this is fine.
But in specific Table class code, you usually also access the entities' concrete properties. Here using this typehint is somewhat a lie. To please IDE and tooling like PHPStan we can at least fix up the doc block, however. And that is what this task is doing, declaring the concrete entity to be available and used inside.
Inside the concrete PostsTable after running the callbacks command:
/**
* @param \Cake\Event\Event $event Event
* @param \App\Model\Entity\Post $entity Entity
* @param \ArrayObject $options Options
* @return void
*/
public function beforeSave(Event $event, EntityInterface $entity, ArrayObject $options)
The tooling now knows to expect the apps' Post entity and its methods/properties to be available.
You can also add your own tasks into the collection to make certain changes for other CakePHP callbacks. See docs for details.
Fix classes annotation inside subfolders.
Fix classes annotation inside subfolders.
Added Query::find() auto-complete besides the existing Table::find(), e.g. in callbacks: `php $searchManager ->callback('tag', [ 'callback' => functio
Added Query::find() auto-complete besides the existing Table::find(), e.g. in callbacks:
$searchManager
->callback('tag', [
'callback' => function (QueryInterface $query, array $args) {
$query->find('tagged', $args);
}
]);
The tagged finder would be autocompleted now.
Here is an example in PHPStorm:
In order to run certain "fixers" over all classes, class annotations and their tasks are now available. Out of the box it will already ship with one: ModelAware annotating.
Inside any non-ORM business logic class, e.g. Service/FooBar layer:
$this->loadModel('Posts');
automatically annotates
@property \App\Model\Table\PostsTable $Posts
above the class then.
This does, however, impact existing ones in terms of -r (remove) cleanup option as it is not completely in sync. So use this only without the -r option for now.
CakePHP 3.6+ support It can, however, be still necessary to set your error level to E_ALL & ~E_USER_DEPRECATED in your app.php config.
Included commits: https://github.com/dereuromark/cakephp-ide-helper/compare/0.11.2...0.12.0
CakePHP 3.6+ support
It can, however, be still necessary to set your error level to E_ALL & ~E_USER_DEPRECATED in your app.php config.
Note: squizlabs/php_codesniffer ^2.8 has been dropped in favor of ^3.0 only.
Use the configured application namespace.
Use the configured application namespace.
Fixed element names for Windows OS users. The slashes inside element names are always forward / (and are not DS at this point).
Fixed element names for Windows OS users. The slashes inside element names are always forward / (and are not DS at this point).
New auto-complete functionality for element() usage in templates: No more typing of the full file name necessary, it will even find your plugin's elem
New auto-complete functionality for element() usage in templates: No more typing of the full file name necessary, it will even find your plugin's elements or nested ones.
Demo: https://streamable.com/ixrbg
CakePHP 3.5 and 3.6 are only supported from here on. This is necessary as 3.4 does not fully work with PHP7.2+, and otherwise testing compatibility is difficult. Make sure you upgraded to at least 3.5 already.
Add saveOrFail() annotation for Table classes.
Allow including all loaded plugins and their helpers to View annotations.
Allow plugin controllers to be annotated with their plugin models.
Allow plugin controllers to be annotated with their plugin models.
Also allow namespaced plugins to be annotated correctly.
Also allow namespaced plugins to be annotated correctly.
Allow dynamically loaded behaviors to be annotated in Table classes.
Allow dynamically loaded behaviors to be annotated in Table classes.
Try catch didnt respect PHP7 errors.
Allow database Type auto-complete.
Allow database Type auto-complete.
Allow adding View class annotations for helpers from controller helpers array.
Add annotations in shells and tasks for loaded tasks.
Only remove inline comments if completely replaced, otherwise just keep it below the new doc block.
One column per quarter.