{"record":{"id":"a20e3a051fc4e054","repo":"phalcon/cphalcon","slug":"setter-injection-parameters-must-be-an-array","errorCode":null,"errorMessage":"Setter injection parameters must be an array","messagePattern":"Setter injection parameters must be an array","errorType":"exception","errorClass":"Phalcon\\Di\\Exceptions\\SetterParametersMustBeArray","httpStatus":null,"severity":"error","filePath":"phalcon/Di/Service/Builder.zep","lineNumber":91,"sourceCode":"                let instance = create_instance_params(\n                    className,\n                    this->buildParameters(container, arguments)\n                );\n            } else {\n                let instance = create_instance(className);\n            }\n        }\n\n        /**\n         * The definition has calls?\n         */\n        if fetch paramCalls, definition[\"calls\"] {\n            if unlikely typeof instance !== \"object\" {\n                throw new SetterInjectionRequiresInstance();\n            }\n\n            if unlikely typeof paramCalls != \"array\" {\n                throw new SetterParametersMustBeArray();\n            }\n\n            /**\n             * The method call has parameters\n             */\n            for methodPosition, method in paramCalls {\n                /**\n                 * The call parameter must be an array of arrays\n                 */\n                if unlikely typeof method != \"array\" {\n                    throw new MethodCallMustBeArray(methodPosition);\n                }\n\n                /**\n                 * A param 'method' is required\n                 */\n                if unlikely !fetch methodName, method[\"method\"] {\n                    throw new MethodNameRequired(methodPosition);","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Di/Service/Builder.zep#L73-L109","documentation":"Thrown by Builder::build when the definition's 'calls' key is present but not an array. The 'calls' entry drives setter injection and must be a list of method-call arrays. Pass an array of call definitions, e.g. [['method'=>'setName','arguments'=>[...]]].","triggerScenarios":"Thrown at phalcon/Di/Service/Builder.zep:91 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Make 'calls' an array, e.g. [['method' => 'setCache', 'arguments' => [...]]]","Remove the 'calls' key if no setter injection is needed"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b7419de9cd0a8a3f48441ead84c9f8415d463e25","analyzedAt":"2026-08-21T06:21:18.811Z","contentChangedAt":"2026-08-21T06:21:18.811Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}