Skip to content

Configuration Reference

All Configure options live under the IdeHelper key in app.php. The canonical reference with defaults is the app.example.php file in the plugin's /config/ directory — that file is the source of truth and can be copy-pasted into your project config.

Common Keys at a Glance

The list below highlights the keys mentioned across this documentation. For the full set, defaults, and the most up-to-date options, see config/app.example.php.

Annotator

KeyTypeNotes
arrayAsGenericsboolUse modern array<type> instead of legacy type[].
genericsInParamfalse | true | 'detailed'Tri-state for table method param types. See Models.
tableEntityQueryboolExpose entity-aware find() return type on tables.
prefixesarrayWhitelist of controller subfolder prefixes.
typeMaparrayMap DB types → PHP types for entity property annotations.
nullableMaparrayMap DB types → nullability flag.
includedPluginsarray | truePlugins to include when annotating helpers in AppView.
templateExtensionsarrayFile extensions processed by the templates annotator. Defaults to ['ctp', 'php'].
skipTemplatePathsarrayTemplate folders the annotator should skip. /templates/Bake/ is skipped by default.
templateCollectionObjectstring | falseFQCN (or iterable/false) used for template collection annotations.
autoCollectbool | callableAuto-collect template variables.
autoCollectBlacklistarrayStrings or regex patterns of variables to exclude from auto-collection.
preemptiveboolPreemptive annotations (e.g. always add @var \App\View\AppView $this to templates).
viewClassstringCustom AppView FQCN.
preferLinkOverUsesInTestsboolUse @link (default) vs. @uses in test class annotations.
propertyTypeMaparrayMap declared property names → inline @var types for class annotations.
annotatorsarrayReplace or disable native annotators.
classAnnotatorTasksarrayRegister or replace class-annotator tasks.
CallbackAnnotatorTasksarrayRegister or replace callback-annotator tasks.

For projects that use PHPStan or Psalm, prefer detailed generic annotations so generated docblocks do not leave bare array types behind:

php
'IdeHelper' => [
    'arrayAsGenerics' => true,
    'objectAsGenerics' => true,
    'genericsInParam' => 'detailed',
    'tableBehaviors' => true,
    'propertyTypeMap' => [
        'actsAs' => 'array<string, mixed>',
        'helpers' => 'array<int|string, string|array<string, mixed>>',
        'components' => 'array<int|string, string|array<string, mixed>>',
        'paginate' => 'array<string, mixed>',
    ],
],

The actsAs property is commonly used by legacy CakePHP apps and plugins to declare behaviors. Helper and component declarations can use shorthand strings or named config arrays before CakePHP normalizes them. Controller $paginate settings are associative configuration arrays. Mapping these properties through propertyTypeMap lets bin/cake annotate classes add the missing iterable value type without changing the native property type.

Generator

KeyTypeNotes
pluginsarrayInclude not-loaded plugins or exclude loaded ones (- prefix).
generatorTasksarrayRegister or replace generator tasks.
skipDatabaseTablesarrayRegex blacklist for the Migrations-tables generator task.

Code Completion

KeyTypeNotes
codeCompletionPathstringCustom output path for code completion files (e.g. ROOT . DS . '.phpstorm.meta.php' . DS).
codeCompletionTasksarrayRegister or replace code completion tasks.

Illuminator

KeyTypeNotes
illuminatorIndentationstringIndentation whitespace; defaults to "\t". Use ' ' for spaces.
IlluminatorTasksarrayRegister or replace Illuminator tasks.

Replacing or Disabling Native Tasks

For each task type, the registration array uses 'CustomKey' => ClassName to add a task, or the native class name as the key to replace one:

php
'IdeHelper' => [
    'annotators' => [
        // Replace a native annotator
        \IdeHelper\Annotator\EntityAnnotator::class => \App\Annotator\MyEnhancedEntityAnnotator::class,
        // Disable a native annotator
        \IdeHelper\Annotator\HelperAnnotator::class => null,
        // Add a custom annotator
        'MyCustomAnnotator' => \App\Annotator\MyCustomAnnotator::class,
    ],
],

The same pattern applies to classAnnotatorTasks, CallbackAnnotatorTasks, generatorTasks, codeCompletionTasks, and IlluminatorTasks.

Released under the MIT License.