| Total Complexity | 6 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class ExampleServiceI implements ExampleService |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var \Modules\Example\Repositories\ExampleRepository |
||
| 12 | */ |
||
| 13 | private $exampleRepository; |
||
| 14 | |||
| 15 | public function __construct(ExampleRepository $dataRepository) |
||
| 16 | { |
||
| 17 | $this->exampleRepository = $dataRepository; |
||
| 18 | } |
||
| 19 | |||
| 20 | public function index(): Response |
||
| 21 | { |
||
| 22 | return Response::handleOk($this->exampleRepository->all()); |
||
| 23 | } |
||
| 24 | |||
| 25 | public function store(array $attributes): Response |
||
| 26 | { |
||
| 27 | return Response::handleCreated($this->exampleRepository->create($attributes)); |
||
| 28 | } |
||
| 29 | |||
| 30 | public function show(int $id): Response |
||
| 31 | { |
||
| 32 | return Response::handleOk($this->exampleRepository->find($id)); |
||
| 33 | } |
||
| 34 | |||
| 35 | public function update(int $id, array $attributes): Response |
||
| 36 | { |
||
| 37 | return Response::handleResetContent($this->exampleRepository->update($attributes, $id)); |
||
| 38 | } |
||
| 39 | |||
| 40 | public function destroy(int $id): Response |
||
| 43 | } |
||
| 44 | } |
||
| 45 |