{"record":{"id":"f507f938101d1e5c","repo":"Leantime/leantime","slug":"this-endpoint-only-supports-patch-requests-f507f9","errorCode":null,"errorMessage":"This endpoint only supports PATCH requests","messagePattern":"This endpoint only supports PATCH requests","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"app/Domain/Timesheets/Hxcontrollers/Stopwatch.php","lineNumber":43,"sourceCode":"    /**\n     * show stop watch\n     */\n    #[RequiresPermission(TimesheetsPermissions::VIEW, global: true)]\n    public function getStatus(): void\n    {\n\n        $onTheClock = session()->exists('userdata') ? $this->timesheetService->isClocked(session('userdata.id')) : false;\n        $this->tpl->assign('onTheClock', $onTheClock);\n    }\n\n    /**\n     * show stop watch\n     */\n    #[RequiresPermission(TimesheetsPermissions::CREATE, global: true)]\n    public function stopTimer(): void\n    {\n        if ($this->incomingRequest->getMethod() !== 'PATCH') {\n            throw new Error('This endpoint only supports PATCH requests');\n        }\n\n        $params = $this->incomingRequest->request->all();\n\n        if (isset($params['action']) && $params['action'] === 'stop') {\n            $ticketId = (int) filter_var($params['ticketId'], FILTER_SANITIZE_NUMBER_INT);\n            $hoursBooked = $this->timesheetService->punchOut($ticketId);\n        }\n\n        $this->tpl->setHTMXEvent('timerUpdate');\n\n        $onTheClock = session()->exists('userdata') ? $this->timesheetService->isClocked(session('userdata.id')) : false;\n        $this->tpl->assign('onTheClock', $onTheClock);\n    }\n\n    #[RequiresPermission(TimesheetsPermissions::CREATE, global: true)]\n    public function startTimer(): void\n    {","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/Leantime/leantime/blob/9a9f49f1008f4782b30f6723c54228f4f992e636/app/Domain/Timesheets/Hxcontrollers/Stopwatch.php#L25-L61","documentation":"Error \"This endpoint only supports PATCH requests\" thrown in Leantime/leantime.","triggerScenarios":"Thrown at app/Domain/Timesheets/Hxcontrollers/Stopwatch.php:43 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":"9a9f49f1008f4782b30f6723c54228f4f992e636","analyzedAt":"2026-08-21T02:37:38.966Z","schemaVersion":2},"datasetVersion":"2026-08-21T03:17:12.404Z"}