File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 3232 $ output = $ result ->toArray ();
3333 return new Response (
3434 200 ,
35- array (
35+ [
3636 'Content-Type ' => 'application/json '
37- ) ,
38- json_encode ($ output )
37+ ] ,
38+ json_encode ($ output, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR )
3939 );
4040 });
4141});
Original file line number Diff line number Diff line change 1212$ server = new Server (function (ServerRequestInterface $ request ) {
1313 return new Response (
1414 200 ,
15- array (
15+ [
1616 'Content-Type ' => 'application/json '
17- ) ,
17+ ] ,
1818 json_encode ([
1919 'id ' => 1 ,
2020 'name ' => 'Avengers ' ,
2121 'description ' => 'a movie '
22- ])
22+ ], JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR )
2323 );
2424});
2525$ socket = new \React \Socket \Server ('0.0.0.0:3000 ' , $ loop );
Original file line number Diff line number Diff line change 1212$ server = new Server (function (ServerRequestInterface $ request ) {
1313 return new Response (
1414 200 ,
15- array (
15+ [
1616 'Content-Type ' => 'application/json '
17- ) ,
17+ ] ,
1818 json_encode ([
1919 'id ' => 2 ,
2020 'title ' => 'Oh snap what an ending ' ,
2121 'grade ' => 5 ,
2222 'comment ' => 'I need therapy after this... ' ,
2323 'product ' => 1
24- ])
24+ ], JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR )
2525 );
2626});
2727$ socket = new \React \Socket \Server ('0.0.0.0:3000 ' , $ loop );
You can’t perform that action at this time.
0 commit comments