MAPG-191 don't create separate variable for data where not necessary
This commit is contained in:
8 files changed
+170
-132
No files matched your search
@@ -29,8 +29,7 @@ class GameFlowController
|
||||
$session = $this->request->session();
|
||||
|
||||
if (!($state = $session->get('state')) || $state['mapId'] !== $mapId) {
|
||||
$data = ['error' => 'no_session_found'];
|
||||
return new JsonContent($data);
|
||||
return new JsonContent(['error' => 'no_session_found']);
|
||||
}
|
||||
|
||||
if (count($state['rounds']) === 0) {
|
||||
@@ -79,8 +78,7 @@ class GameFlowController
|
||||
$session = $this->request->session();
|
||||
|
||||
if (!($state = $session->get('state')) || $state['mapId'] !== $mapId) {
|
||||
$data = ['error' => 'no_session_found'];
|
||||
return new JsonContent($data);
|
||||
return new JsonContent(['error' => 'no_session_found']);
|
||||
}
|
||||
|
||||
$last = $state['rounds'][count($state['rounds']) - 1];
|
||||
@@ -119,7 +117,7 @@ class GameFlowController
|
||||
|
||||
$session->set('state', $state);
|
||||
|
||||
$data = [
|
||||
return new JsonContent([
|
||||
'result' => [
|
||||
'position' => $position->toArray(),
|
||||
'distance' => $distance,
|
||||
@@ -127,8 +125,7 @@ class GameFlowController
|
||||
],
|
||||
'panoId' => $panoId,
|
||||
'pov' => $pov
|
||||
];
|
||||
return new JsonContent($data);
|
||||
]);
|
||||
}
|
||||
|
||||
private function addNewRoundToState(&$state, Place $place, array $placesWithoutPano): void
|
||||
|
||||
Reference in new issue
Block a user