{"record":{"id":"228e49a9d93c5883","repo":"filp/whoops","slug":"whoops-handler-prettypagehandler-geteditor-should","errorCode":null,"errorMessage":"Whoops\\Handler\\PrettyPageHandler::getEditor should always resolve to a string or a valid editor array; got something else instead.","messagePattern":"Whoops\\\\Handler\\\\PrettyPageHandler::getEditor should always resolve to a string or a valid editor array; got something else instead\\.","errorType":"exception","errorClass":"UnexpectedValueException","httpStatus":null,"severity":"error","filePath":"src/Whoops/Handler/PrettyPageHandler.php","lineNumber":521,"sourceCode":"     * @param string $filePath\n     * @param int    $line\n     *\n     * @throws InvalidArgumentException If editor resolver does not return a string\n     *\n     * @return string|bool\n     */\n    public function getEditorHref($filePath, $line)\n    {\n        $editor = $this->getEditor($filePath, $line);\n\n        if (empty($editor)) {\n            return false;\n        }\n\n        // Check that the editor is a string, and replace the\n        // %line and %file placeholders:\n        if (!isset($editor['url']) || !is_string($editor['url'])) {\n            throw new UnexpectedValueException(\n                __METHOD__ . \" should always resolve to a string or a valid editor array; got something else instead.\"\n            );\n        }\n\n        $editor['url'] = str_replace(\"%line\", rawurlencode($line), $editor['url']);\n        $editor['url'] = str_replace(\"%file\", rawurlencode($filePath), $editor['url']);\n\n        return $editor['url'];\n    }\n\n    /**\n     * Determine if the editor link should act as an Ajax request.\n     *\n     * @param string $filePath\n     * @param int    $line\n     *\n     * @throws UnexpectedValueException If editor resolver does not return a boolean\n     *","sourceCodeStart":503,"sourceCodeEnd":539,"githubUrl":"https://github.com/filp/whoops/blob/fa1bc9c95a1b392fbdb8a410dbbcb1d6a030fff7/src/Whoops/Handler/PrettyPageHandler.php#L503-L539","documentation":"Error \"Whoops\\Handler\\PrettyPageHandler::getEditor should always resolve to a string or a valid editor array; got something else instead.\" thrown in filp/whoops.","triggerScenarios":"Thrown at src/Whoops/Handler/PrettyPageHandler.php:521 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa1bc9c95a1b392fbdb8a410dbbcb1d6a030fff7","analyzedAt":"2026-08-21T01:30:26.400Z","schemaVersion":2},"datasetVersion":"2026-08-21T03:17:12.404Z"}