change fn to function -- style
This commit is contained in:
parent
68da48aedd
commit
4fe10214d5
1 changed files with 6 additions and 4 deletions
|
|
@ -18,10 +18,12 @@ class TextController
|
||||||
{
|
{
|
||||||
$texts = $this->textRepository->getAll();
|
$texts = $this->textRepository->getAll();
|
||||||
|
|
||||||
$data = array_map(fn($text) => [
|
$data = array_map(function ($text) {
|
||||||
'id' => $text->getId(),
|
return [
|
||||||
'name' => $text->getName(),
|
'id' => $text->getId(),
|
||||||
], $texts);
|
'name' => $text->getName(),
|
||||||
|
];
|
||||||
|
}, $texts);
|
||||||
|
|
||||||
$response->getBody()->write(json_encode($data));
|
$response->getBody()->write(json_encode($data));
|
||||||
return $response->withHeader('Content-Type', 'application/json');
|
return $response->withHeader('Content-Type', 'application/json');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue