{"record":{"id":"c1258986137af94e","repo":"filp/whoops","slug":"callable-to-whoops-exception-framecollection-map","errorCode":null,"errorMessage":"Callable to Whoops\\Exception\\FrameCollection::map must return a Frame object","messagePattern":"Callable to Whoops\\\\Exception\\\\FrameCollection::map must return a Frame object","errorType":"exception","errorClass":"UnexpectedValueException","httpStatus":null,"severity":"error","filePath":"src/Whoops/Exception/FrameCollection.php","lineNumber":61,"sourceCode":"        $this->frames = array_values(array_filter($this->frames, $callable));\n        return $this;\n    }\n\n    /**\n     * Map the collection of frames\n     *\n     * @param  callable        $callable\n     * @return FrameCollection\n     */\n    public function map($callable)\n    {\n        // Contain the map within a higher-order callable\n        // that enforces type-correctness for the $callable\n        $this->frames = array_map(function ($frame) use ($callable) {\n            $frame = call_user_func($callable, $frame);\n\n            if (!$frame instanceof Frame) {\n                throw new UnexpectedValueException(\n                    \"Callable to \" . __CLASS__ . \"::map must return a Frame object\"\n                );\n            }\n\n            return $frame;\n        }, $this->frames);\n\n        return $this;\n    }\n\n    /**\n     * Returns an array with all frames, does not affect\n     * the internal array.\n     *\n     * @todo   If this gets any more complex than this,\n     *         have getIterator use this method.\n     * @see    FrameCollection::getIterator\n     * @return array","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/filp/whoops/blob/fa1bc9c95a1b392fbdb8a410dbbcb1d6a030fff7/src/Whoops/Exception/FrameCollection.php#L43-L79","documentation":"Error \"Callable to Whoops\\Exception\\FrameCollection::map must return a Frame object\" thrown in filp/whoops.","triggerScenarios":"Thrown at src/Whoops/Exception/FrameCollection.php:61 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"}