{"record":{"id":"afb360e5c7cebc9f","repo":"PHPOffice/PHPWord","slug":"invalid-parameters-passed","errorCode":null,"errorMessage":"Invalid parameters passed.","messagePattern":"Invalid parameters passed\\.","errorType":"exception","errorClass":"PhpOffice\\PhpWord\\Exception\\Exception","httpStatus":null,"severity":"error","filePath":"src/PhpWord/Writer/Word2007/Part/Rels.php","lineNumber":123,"sourceCode":"     * @param string $target Relationship target\n     * @param string $targetMode Relationship target mode\n     */\n    private function writeRel(XMLWriter $xmlWriter, $relId, $type, $target, $targetMode = ''): void\n    {\n        if ($type != '' && $target != '') {\n            if (strpos($relId, 'rId') === false) {\n                $relId = 'rId' . $relId;\n            }\n            $xmlWriter->startElement('Relationship');\n            $xmlWriter->writeAttribute('Id', $relId);\n            $xmlWriter->writeAttribute('Type', 'http://schemas.openxmlformats.org/' . $type);\n            $xmlWriter->writeAttribute('Target', $target);\n            if ($targetMode != '') {\n                $xmlWriter->writeAttribute('TargetMode', $targetMode);\n            }\n            $xmlWriter->endElement();\n        } else {\n            throw new Exception('Invalid parameters passed.');\n        }\n    }\n}\n","sourceCodeStart":105,"sourceCodeEnd":127,"githubUrl":"https://github.com/PHPOffice/PHPWord/blob/aef95c04151b5633cc505f672ddd6a71da900ee1/src/PhpWord/Writer/Word2007/Part/Rels.php#L105-L127","documentation":"Validation guard in Rels::writeRel: relationship entries are only written when both $type and $target are non-empty; a caller (writeRels/writeMediaRel) passed an incomplete relationship (empty type or target) so the parameters are considered invalid.","triggerScenarios":"Thrown at src/PhpWord/Writer/Word2007/Part/Rels.php:123 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure every relationship added to Rels supplies a non-empty type and target.","Check custom code or hooks that call addRelationship/writeRels with incomplete arguments."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"aef95c04151b5633cc505f672ddd6a71da900ee1","analyzedAt":"2026-09-14T10:53:58.933Z","contentChangedAt":"2026-09-14T10:53:58.933Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}