{"record":{"id":"53fe1ff4fa1e49bb","repo":"filp/whoops","slug":"argument-to-whoops-handler-callbackhandler-cons","errorCode":null,"errorMessage":"Argument to Whoops\\Handler\\CallbackHandler::__construct must be valid callable","messagePattern":"Argument to Whoops\\\\Handler\\\\CallbackHandler::__construct must be valid callable","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/Whoops/Handler/CallbackHandler.php","lineNumber":30,"sourceCode":" * Wrapper for Closures passed as handlers. Can be used\n * directly, or will be instantiated automagically by Whoops\\Run\n * if passed to Run::pushHandler\n */\nclass CallbackHandler extends Handler\n{\n    /**\n     * @var callable\n     */\n    protected $callable;\n\n    /**\n     * @throws InvalidArgumentException If argument is not callable\n     * @param  callable                 $callable\n     */\n    public function __construct($callable)\n    {\n        if (!is_callable($callable)) {\n            throw new InvalidArgumentException(\n                'Argument to ' . __METHOD__ . ' must be valid callable'\n            );\n        }\n\n        $this->callable = $callable;\n    }\n\n    /**\n     * @return int|null\n     */\n    public function handle()\n    {\n        $exception = $this->getException();\n        $inspector = $this->getInspector();\n        $run       = $this->getRun();\n        $callable  = $this->callable;\n\n        // invoke the callable directly, to get simpler stacktraces (in comparison to call_user_func).","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/filp/whoops/blob/fa1bc9c95a1b392fbdb8a410dbbcb1d6a030fff7/src/Whoops/Handler/CallbackHandler.php#L12-L48","documentation":"Error \"Argument to Whoops\\Handler\\CallbackHandler::__construct must be valid callable\" thrown in filp/whoops.","triggerScenarios":"Thrown at src/Whoops/Handler/CallbackHandler.php:30 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"}