{
"event": "PreToolUse",
"tool_name": "Grep",
"tool_input": {
"pattern": "public function store|POST.*tasks",
"path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Controller\/Api\/TaskController.php",
"output_mode": "content",
"-A": 30
}
}
{
"tool_response": {
"mode": "content",
"numFiles": 0,
"filenames": [],
"content": "111: public function store(): void\n112- {\n113- try {\n114- $input = $this->getJsonInput();\n115-\n116- $task = $this->createTaskUseCase->execute($input);\n117-\n118- $this->json([\n119- 'success' => true,\n120- 'data' => $task->toArray(),\n121- ], 201);\n122- } catch (\\InvalidArgumentException $e) {\n123- $this->json(['success' => false, 'error' => $e->getMessage()], 400);\n124- } catch (\\Exception $e) {\n125- $this->jsonError($e->getMessage());\n126- }\n127- }\n128-\n129- public function update(string $id): void\n130- {\n131- try {\n132- $input = $this->getJsonInput();\n133- $task = $this->getTasksUseCase->findById((int) $id);\n134-\n135- if ($task === null) {\n136- $this->json(['success' => false, 'error' => 'Task not found'], 404);\n137-\n138- return;\n139- }\n140-\n141- if (isset($input['title']) || isset($input['description'])) {\n--\n256: public function storeResult(string $id): void\n257- {\n258- try {\n259- $input = $this->getJsonInput();\n260-\n261- $result = $this->saveResultUseCase->execute((int) $id, $input);\n262-\n263- $this->json([\n264- 'success' => true,\n265- 'data' => $result->toArray(),\n266- ], 201);\n267- } catch (\\InvalidArgumentException $e) {\n268- $this->json(['success' => false, 'error' => $e->getMessage()], 400);\n269- } catch (\\Exception $e) {\n270- $this->jsonError($e->getMessage());\n271- }\n272- }\n273-\n274- public function getResults(string $id): void\n275- {\n276- try {\n277- $results = $this->resultRepository->findByTaskId((int) $id);\n278-\n279- $this->json([\n280- 'success' => true,\n281- 'data' => array_map(fn ($r) => $r->toArray(), $results),\n282- ]);\n283- } catch (\\Exception $e) {\n284- $this->jsonError($e->getMessage());\n285- }\n286- }",
"numLines": 63
}
}