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();
|
||||
|
||||
$data = array_map(fn($text) => [
|
||||
'id' => $text->getId(),
|
||||
'name' => $text->getName(),
|
||||
], $texts);
|
||||
$data = array_map(function ($text) {
|
||||
return [
|
||||
'id' => $text->getId(),
|
||||
'name' => $text->getName(),
|
||||
];
|
||||
}, $texts);
|
||||
|
||||
$response->getBody()->write(json_encode($data));
|
||||
return $response->withHeader('Content-Type', 'application/json');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue