{"record":{"id":"9dc5ad6b557d047f","repo":"phalcon/cphalcon","slug":"parameter-content-is-required","errorCode":null,"errorMessage":"Parameter 'content' is required","messagePattern":"Parameter 'content' is required","errorType":"exception","errorClass":"Phalcon\\Translate\\Exceptions\\MissingRequiredParameter","httpStatus":null,"severity":"error","filePath":"phalcon/Translate/Adapter/Csv.zep","lineNumber":50,"sourceCode":"    protected array translate = [];\n\n    /**\n     * Csv constructor.\n     *\n     * @phpstan-param translate_csv_options $options\n     *\n     * @throws Exception\n     */\n    public function __construct(\n        <InterpolatorFactory> interpolator,\n        array options\n    ) {\n        var delimiter, enclosure, escape;\n\n        parent::__construct(interpolator, options);\n\n        if unlikely !isset options[\"content\"] {\n            throw new MissingRequiredParameter(\"content\");\n        }\n\n        if isset options[\"delimiter\"] {\n            let delimiter = options[\"delimiter\"];\n        } else {\n            let delimiter = \";\";\n        }\n\n        if isset options[\"enclosure\"] {\n            let enclosure = options[\"enclosure\"];\n        } else {\n            let enclosure = \"\\\"\";\n        }\n\n        if isset options[\"escape\"] {\n            let escape = options[\"escape\"];\n        } else {\n            let escape = \"\\\\\";","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Translate/Adapter/Csv.zep#L32-L68","documentation":"The Csv translate adapter loads its dictionary from a CSV file whose path must be supplied in the 'content' option; Csv::__construct() checks isset options['content'] right after the parent constructor and throws Phalcon\\Translate\\Exceptions\\MissingRequiredParameter('content') when it is absent (phalcon/Translate/Adapter/Csv.zep:50).","triggerScenarios":"new Csv($interpolatorFactory, ['delimiter' => ',']) — any options array without a 'content' key. Note that for this adapter 'content' is the CSV file path, not the translations array.","commonSituations":"Copying a NativeArray config (where 'content' is the data array) to Csv; naming the key 'file' or 'path' instead of 'content'; options arrays built conditionally where the content assignment is skipped; typos in the option name.","solutions":["Pass 'content' => '/absolute/path/to/messages.csv' in the options array.","Check the exact key name and casing — it must be 'content'.","When wiring in DI, define the service with the full options array including 'content' so every instantiation is complete."],"exampleFix":"// before\n$t = new Csv($factory, ['delimiter' => ',']); // no content\n\n// after\n$t = new Csv($factory, [\n    'content'   => dirname(__DIR__) . '/messages/en.csv',\n    'delimiter' => ',',\n]);","handlingStrategy":"validation","validationCode":"$required = ['content'];\n$missing = array_diff($required, array_keys($options));\nif ($missing !== []) {\n    throw new InvalidArgumentException('Csv adapter missing options: ' . implode(', ', $missing));\n}\n$t = new Csv($factory, $options);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build adapter options in one factory per adapter so required keys are always present.","Remember the convention: Csv 'content' = file path; NativeArray 'content' = data array.","Add constructor options to the DI service definition instead of passing partial arrays at call sites."],"tags":["phalcon","translate","csv","adapter","missing-option","i18n"],"backgroundTag":"missing-required-option","analyzedSha":"b7419de9cd0a8a3f48441ead84c9f8415d463e25","analyzedAt":"2026-08-21T06:21:18.811Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}